> david.g.johns...@gmail.com wrote:
> 
> At the level of discussion you want to have when you encounter unfamiliar 
> syntax please read the syntax chapter for the related concept (expression 
> identifiers).
> 
> https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
 
Thanks. That section makes a valiant attempt to distinguish between 
"identifier" (as a token in a SQL statement or, say PL/pgSQL source code) and 
"name" as what the identifier denotes. But (I think) it slips up here:

«
A convention often used is to write key words in upper case and names in lower 
case, e.g.:

UPDATE my_table SET a = 5;
»

It should be « to write key words in upper case and unquoted identifiers in 
lower case », yes?

About my

 search_path 
-------------
 """x"""

yes, I was confused—by, for example, this precedent.

create table "He said ""dog"", I think."(k int);
\d

I see this:

                List of relations
 Schema |          Name           | Type  | Owner 
--------+-------------------------+-------+-------
 u1     | He said "dog", I think. | table | u1

So here the convention is to list the name of the table and not the identifier 
that denoted the intended name at creation time.

The situation is analogous with setting the search_path. I want to talk about 
schemas. Schemas have names. So in SQL syntax, I must denote these names by 
writing identifiers. It could have been decided that the proper way to display 
a search_path is by listing the schema names (just as \d does for tables). But 
it was decided, instead, to denote the path by the list of identifiers that 
denote the schema names. This doesn't present a huge usability challenge. But 
it is, nevertheless, a rule that you have to learn (which I had) and then 
remember (which I didn't).





Reply via email to