pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: david@calascibetta.com
Subject: BUG #17258: Unexpected results in CHAR(1) data type
Date: Fri, 29 Oct 2021 18:14:56 +0000
Message-ID: <17258-a7c164c5fb955221@postgresql.org> (raw)

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)



view thread (19+ messages)  latest in thread

Message-ID: <17258-a7c164c5fb955221@postgresql.org>
Permalink:  ../17258-a7c164c5fb955221@postgresql.org/
Also on:    postgresql.org/message-id/17258-a7c164c5fb955221@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, david@calascibetta.com
  Subject: Re: BUG #17258: Unexpected results in CHAR(1) data type
  In-Reply-To: <17258-a7c164c5fb955221@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox