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?
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
charorcharacter, they're horrible legacy data types with surprising and confusing behaviours. Usevarcharortext.