Re: [HACKERS] char() datatype looses strings of all spaces

2003-08-16 Thread Stephan Szabo
On Sat, 16 Aug 2003, Joe Conway wrote: > I stumbled across this behavior today and it seems strange if not a bug: > > -- this seems wrong > vsconf=# create table foo (f1 char(1)); > CREATE TABLE > vsconf=# insert into foo values(' '); > INSERT 9002011 1 > vsconf=# select ascii(f1) from foo; > as

Re: [HACKERS] char() datatype looses strings of all spaces

2003-08-16 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > I stumbled across this behavior today and it seems strange if not a bug: ascii() is defined as ascii(text). As of 7.4, bpchar->text conversion strips trailing blanks, so what ascii() sees is a zero-length string. Given that trailing blanks are insignifica

Re: [HACKERS] char() datatype looses strings of all spaces

2003-08-16 Thread Joe Conway
Tom Lane wrote: ascii() is defined as ascii(text). As of 7.4, bpchar->text conversion strips trailing blanks, so what ascii() sees is a zero-length string. That makes sense -- I was wondering where the blanks got stripped. Given that trailing blanks are insignificant in bpchar, I'm not sure I'd c

[HACKERS] char() datatype looses strings of all spaces

2003-08-16 Thread Joe Conway
I stumbled across this behavior today and it seems strange if not a bug: -- this seems wrong vsconf=# create table foo (f1 char(1)); CREATE TABLE vsconf=# insert into foo values(' '); INSERT 9002011 1 vsconf=# select ascii(f1) from foo; ascii --- 0 (1 row) -- this is what I'd expect vsco