Re: char() datatype looses strings of all spaces - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: char() datatype looses strings of all spaces
Date
Msg-id 20030816223244.B78105-100000@megazone.bigpanda.com
Whole thread Raw
In response to char() datatype looses strings of all spaces  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
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;
>   ascii
> -------
>       0
> (1 row)

I think the reason for this is that ascii is actually
defined ascii(text) and the conversion from char(n)
to text now drops the trailing spaces.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: char() datatype looses strings of all spaces
Next
From: Andreas Pflug
Date:
Subject: Re: Stuff that doesn't work yet in IPv6 patch