pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: gcso@sqliteonline.com
Subject: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
Date: Mon, 16 Sep 2024 07:29:54 +0000
Message-ID: <18619-fc593e84ad9763fb@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18619
Logged by:          Kirill N
Email address:      gcso@sqliteonline.com
PostgreSQL version: 17rc1
Operating system:   docker 17rc1
Description:        

Hello, 

If you create a table with field names in uppercase and put them in
quotation marks.
then such fields can be accessed only with quotation marks. 

postgres=# create table a ("b" int, "C" int);
CREATE TABLE
postgres=# select b from a;
 b 
---
(0 rows)

postgres=# select c from a;
ERROR:  column "c" does not exist
LINE 1: select c from a;
               ^
postgres=# select C from a;
ERROR:  column "c" does not exist
LINE 1: select C from a;
               ^
postgres=# select "c" from a;
ERROR:  column "c" does not exist
LINE 1: select "c" from a;
               ^
postgres=# select "C" from a;
 C 
---
(0 rows)



The table structure is returned without quotation marks

postgres=# SELECT 
    t.table_schema,
    t.table_name,
    c.column_name,
    c.data_type
FROM 
    information_schema.tables t
JOIN 
    information_schema.columns c
ON 
    t.table_schema = c.table_schema
    AND t.table_name = c.table_name
WHERE 
    t.table_type = 'BASE TABLE'
    AND t.table_schema NOT IN ('information_schema', 'pg_catalog')  --
Исключаем системные схемы
ORDER BY 
    t.table_schema,
    t.table_name,
    c.ordinal_position;
 table_schema | table_name |  column_name  |     data_type     
--------------+------------+---------------+-------------------
 public       | a          | b             | integer
 public       | a          | C             | integer



view thread (6+ messages)  latest in thread

Message-ID: <18619-fc593e84ad9763fb@postgresql.org>
Permalink:  ../18619-fc593e84ad9763fb@postgresql.org/
Also on:    postgresql.org/message-id/18619-fc593e84ad9763fb@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, gcso@sqliteonline.com
  Subject: Re: BUG #18619: uppercase column with quotation marks, gets an error without quotation marks
  In-Reply-To: <18619-fc593e84ad9763fb@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox