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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "gcso(at)sqliteonline(dot)com" <gcso(at)sqliteonline(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
Date: 2024-09-16 13:39:09
Message-ID: CAKFQuwb91cntHeEVHFJTuRQehL=i3WkF-nBmGYvaLENPQY4_-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Monday, September 16, 2024, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-09-16 17:28:30 Re: BUG #18618: pg_upgrade from 14 to 15+ fails for unlogged table with identity column
Previous Message David G. Johnston 2024-09-16 13:29:21 Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks