Thanks to visit codestin.com
Credit goes to postgrespro.com

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

The following bug has been logged on the website:

Bug reference:      17258
Logged by:          David Calascibetta
Email address:      [email protected]
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()