Re: Lower/upper-case consistency with function names

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Lower/upper-case consistency with function names
Дата
Msg-id 20220605082743.dts3yqpgcuqnh5y4@jrouhaud
обсуждение исходный текст
Ответ на Lower/upper-case consistency with function names  (Shay Rojansky <roji@roji.org>)
Ответы Re: Lower/upper-case consistency with function names  (Shay Rojansky <roji@roji.org>)
Список pgsql-docs
Hi,

On Sun, Jun 05, 2022 at 10:20:23AM +0200, Shay Rojansky wrote:
>
> The PostgreSQL docs mostly show function names in lowercase (e.g. [1],
> [2]), which seems to be the PostgreSQL-idiomatic thing to do. However, some
> pages show functions in upper case, e.g. COALESCE/NULLIF/GREATEST/LEAST
> ([3]). Is there some difference between these which warrants the case
> difference, or just a case of docs inconsistency?
>
> I ran into this while trying to make Entity Framework (.NET ORM) generate
> more idiomatic-looking SQL. If this is just an inconsistency, it's
> obviously not very important.

As mentioned in the doc in [3], COALESCE and all the others are actually not
functions (those are specific keywords handled in the parser):

> Although COALESCE, GREATEST, and LEAST are syntactically similar to
> functions, they are not ordinary functions, and thus cannot be used with
> explicit VARIADIC array arguments.

As the rest of the keywords, they're case insensitive but our convention is to
document them in uppercase.

> [3] https://www.postgresql.org/docs/current/functions-conditional.html



В списке pgsql-docs по дате отправления:

Предыдущее
От: Shay Rojansky
Дата:
Сообщение: Lower/upper-case consistency with function names
Следующее
От: Shay Rojansky
Дата:
Сообщение: Re: Lower/upper-case consistency with function names