Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
Date
Msg-id CAKFQuwb91cntHeEVHFJTuRQehL=i3WkF-nBmGYvaLENPQY4_-A@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
Next
From: Tom Lane
Date:
Subject: Re: BUG #18618: pg_upgrade from 14 to 15+ fails for unlogged table with identity column