Re: char() datatype looses strings of all spaces

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: char() datatype looses strings of all spaces
Date: 2003-08-17 05:33:56
Message-ID: 20030816223244.B78105-100000@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-08-17 05:34:48 Re: char() datatype looses strings of all spaces
Previous Message Bruce Momjian 2003-08-17 05:24:40 Re: HISTORY