Shachar Shemesh <[EMAIL PROTECTED]> writes: > What I don't understand is this. The cast from varchar to text is a > no-function one. I.e. - they are defined to be memory-represented the > same. If that is the case, one would expect them to also share the input > and ouput functions. When looking at the catalog, however, it appears > that textin is used to input text, while varcharin is used for varchars.
Sure. Identical internal representation does not necessarily imply identical functionality. varcharin needs to enforce a maximum length (and now that I think of it, varcharrecv does too; that's an oversight). Another example is that abstime is binary-compatible to integer. Should they have the same input function? > It gets wierder. The binary receive function for varchar (varcharrecv) > is different than the one for text (textrecv), but the C implementation > of the former simply calls the C implementation of the later. Why not > define them to be the same at the SQL level? So we can fix bugs like the one above without forcing initdb. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org