Re: How to quote the COALESCE function? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to quote the COALESCE function?
Date
Msg-id 25882.1459207856@sss.pgh.pa.us
Whole thread Raw
In response to How to quote the COALESCE function?  (Roman Scherer <roman@burningswell.com>)
List pgsql-general
Roman Scherer <roman@burningswell.com> writes:
> Can someone explain to me what's the difference between quoting
> the `upper` and the `coalesce` function?

COALESCE is a keyword.

> What I found so far is, that the `upper` function can be found in
> the `pg_proc` table but not `coalesce`.

Yup.

> Does this mean that `coalesce` isn't a classical function and I
> shouldn't quote it? Is it instead a keyword, as described in
> the "Lexical Structure" section of the docs [2]? How can I find
> out which other functions are not meant to be quoted?

Yes, yes, and you already found one good way: if it doesn't have
a pg_proc entry then it's a special case of some sort or other.

Have you considered only quoting the function name if it actually
needs it, ie, contains special characters?

            regards, tom lane


pgsql-general by date:

Previous
From: John Turner
Date:
Subject: Re: Unique values on multiple tables
Next
From: Jerry Sievers
Date:
Subject: Re: How to quote the COALESCE function?