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.