pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: andy.bolstridge@gmail.com
Subject: caes insensitivity
Date: Fri, 17 Apr 2020 16:47:20 +0000
Message-ID: <158714204000.25700.10626536768502518218@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/sql-syntax-lexical.html
Description:

The docs are misleading about the case insensitive nature, as someone new to
postgresql, I found it very confusing.

The doc (under 4.1.1. Identifiers and Key Words) says:

UPDATE MY_TABLE SET A = 5;  can equivalently be written as: uPDaTE my_TabLE
SeT a = 5;

However, this will never work unless the underlying table is created in
lower case. The "case insensitivity" appears to make everything in the query
lowercase. This is not the same thing as being case insensitive.

so if I have a table created as My_Table, I can *only* access it by quoting
it. 'Select * from my_table' does not work, nor does 'Select * from
MY_TABLE', and nor does the expected 'Select * from My_Table'.

If the query was case insensitive, it should still work, finding the
underlying table regardless of its case. But as this obviously does not
work, it should not be documented as such. 

Instead the reality of the system should be documented - that all queries
are turned into lower case and the lower-case transformation is run, unless
the text is explicitly quoted.


view thread (2+ messages)  latest in thread

Message-ID: <158714204000.25700.10626536768502518218@wrigleys.postgresql.org>
Permalink:  ../158714204000.25700.10626536768502518218@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/158714204000.25700.10626536768502518218@wrigleys.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-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, andy.bolstridge@gmail.com
  Subject: Re: caes insensitivity
  In-Reply-To: <158714204000.25700.10626536768502518218@wrigleys.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