Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

BUG #17258: Unexpected results in CHAR(1) data type - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17258: Unexpected results in CHAR(1) data type
Date
Msg-id 17258-a7c164c5fb955221@postgresql.org
Whole thread Raw
Responses Re: BUG #17258: Unexpected results in CHAR(1) data type
Re: BUG #17258: Unexpected results in CHAR(1) data type
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17258
Logged by:          David Calascibetta
Email address:      david@calascibetta.com
PostgreSQL version: 12.8
Operating system:   AWS RDS
Description:

My understanding is that a CHAR(1) column can never be 0 (zero) length.
I expect the results of these two SELECT statements to produce the same
result:

select length(substr('   '::varchar,1,1)), ascii(substr('
'::varchar,1,1));
produces==> 1    32   (as expected)

select length(substr('   '::char,1,1)), ascii(substr('   '::char,1,1));
produces==> 0     0     (not as expected)


pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17256: Running pgagent on a custom user
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #17257: (auto)vacuum hangs within lazy_scan_prune()