Is `DATE` a function?

Поиск
Список
Период
Сортировка
От jinser
Тема Is `DATE` a function?
Дата
Msg-id CAK3STzGm-8_5yvyWm_SJALo1Wb1i3cMJrBj8=WPmVyxHdhmYrg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is `DATE` a function?  (Bzzzz <lazyvirus@gmx.com>)
Re: Is `DATE` a function?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Is `DATE` a function?  (Cory Albrecht <cory@albrecht.name>)
Список pgsql-novice
Hello, Friends,

Use it like a normal function:

playground=# SELECT DATE();
ERROR:  function date() does not exist
LINE 1: SELECT DATE();
               ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.

playground=# SELECT DATE('2022-01-13');
    date
------------
 2022-01-13
(1 row)

Another reason I think this is a function is that other types don't
seem to have the same behavior:

playground=# SELECT integer('123');
ERROR:  syntax error at or near "("
LINE 1: SELECT integer('123');
                      ^

The Table 9.33. Date/Time Functions in the documentation
(https://www.postgresql.org/docs/16/functions-datetime.html#FUNCTIONS-DATETIME-TABLE)
doesn't mention this...
If I missed it, where should I find the description? Or maybe it
actually should be in this table?

Thanks in advance.



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Reporting by family tree
Следующее
От: Bzzzz
Дата:
Сообщение: Re: Is `DATE` a function?