Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: "gcso@sqliteonline.com" <gcso@sqliteonline.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2024-09-16T13:39:09Z
Lists: pgsql-bugs
On Monday, September 16, 2024, David G. Johnston <david.g.johnston@gmail.com>
wrote:

>
> You are compelled to use quote_ident (or format code I) if you want to
> interpolate stored identifiers into SQL where case-folding happens.  But
> the quoting is purely a SQL syntax artifact, the identifier itself does not
> include the syntax quotes as part of its value.
>

It is no different than writing:

 Insert into tbl (text)col) values (‘string’);

When you query tbl.text_col you see an unquoted string, not the word string
with single quotes.  Because the quotes are query structure syntax, not
part of the value they surround.  It’s just that identifiers use optional
double-quotes instead of the mandatory single quotes used for literals.

David J.