Re: char() datatype looses strings of all spaces

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:34:48
Message-ID: 9284.1061098488@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> 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 insignificant in bpchar, I'm not sure I'd
call this a bug. If we decide it is, we could work around it by
creating an ascii(bpchar) entry ... but what's the argument that says
insignificant trailing blanks must map to the same thing as significant
blanks?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-08-17 05:37:26 Re: char() datatype looses strings of all spaces
Previous Message Stephan Szabo 2003-08-17 05:33:56 Re: char() datatype looses strings of all spaces