1

On my postgresql database, i've declared all String field as

character(n)

Now i have some function that takes string argument as

varchar(n)

are this two datatype compatible or should i change type in function or in table declarement?

2
  • 2
    Don't use char or character, they're horrible legacy data types with surprising and confusing behaviours. Use varchar or text. Commented Jul 11, 2013 at 9:02
  • i was using character instead varchar because of some mysql scripting habit :) now i've modify all my db Commented Jul 11, 2013 at 9:07

1 Answer 1

1

Character types character(n) and varchar(n) are compatible and internally are the same type (but have different representation, when queried).

Details in this article

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.