Search Postgresql Archives

Re: Seems to be impossible to set a NULL search_path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 6, 2022 at 10:03 AM Christophe Pettus <xof@xxxxxxxxxxxx> wrote:


> On Jul 6, 2022, at 09:48, Bryn Llewellyn <bryn@xxxxxxxxxxxx> wrote:
> Neither causes an error. The "show", in each case, prints the bare value with no quotes. It never struck me try try double quotes around the timezone argument. I'm shocked that they are silently accepted here and seem to have the same effect (in this syntax setting) as single quotes.

It's really a lot easier than it is being made out to be.

GUCs accept a string as a value, which might then be converted to other values based on the semantics of the GUC.  PostgreSQL generously accepts three different ways of delimiting this string:

1. Single quotes (as in SQL).
2. Double quotes (which in SQL, yes, are used to delimit names).
3. No delimiter at all if there are no embedded characters that would terminate the value prematurely.


4. Dollar quoting

postgres=# set search_path to $$testschema$$;
SET
postgres=# show search_path;
 search_path
-------------
 testschema
(1 row)

Thus a more accurate syntax specification would be (at least for search_path):

SET [ SESSION | LOCAL ] configuration_parameter { TO | = } value [, ...]

Where value is one of:
 { identifier | string_constant | DEFAULT }

And those first two are the defined terms in SQL Syntax.

That covers all four options split among the two defined types.

Now, maybe that doesn't work for other GUCs and so this level of imprecision is acceptable...I'm ok with coming away from this conversation with the status quo but I'm not going to try and claim there isn't anything confusing here.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux