Re: [HACKERS] SELECT BUG - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] SELECT BUG
Date
Msg-id 12054.936338368@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] SELECT BUG  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> This inconsistency bothers me: I've always thought that char(),
>> varchar(), and text() are functionally interchangeable, but it seems
>> that's not so.  Is this behavior mandated by SQL92?

> I haven't found any explicit reference to a distinction between CHAR
> and VARCHAR in the docs nor a discussion of the SQL_TEXT character set
> wrt this topic. So apparently SQL_TEXT properties are implementation
> defined too. But we should look into it more before deciding to change
> anything because afaik the current behavior has been the same in
> Postgres forever...

I'm not necessarily arguing for a change; if you're satisfied that
the existing comparison logic obeys the spec, it's OK with me.
(Ignoring trailing blanks in bpchar does seem reasonable when you
think about it.)

But if it is correct, then we need to turn off oprcanhash for bpchareq.
Odd that no one has noticed this before.

Some doc updates might be in order too...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] md.c is feeling much better now, thank you
Next
From: Andreas Zeugswetter
Date:
Subject: Re: [HACKERS] SELECT BUG