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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
Дата
Msg-id CAKFQuwb91cntHeEVHFJTuRQehL=i3WkF-nBmGYvaLENPQY4_-A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления: