Re: PSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PSQL
Дата
Msg-id 27170.1278425798@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PSQL  (Atif Jung <atifjung@gmail.com>)
Список pgsql-novice
Atif Jung <atifjung@gmail.com> writes:
> I'm having problems with the following stored procedure. The problematic
> line is the one in red. Any help greatly appreciated.

> CREATE or replace FUNCTION converttojulian(datex DATE) RETURNS CHAR(5) AS $$
> ...
>    m1 := EXTRACT (MONTH FROM DATE datex);

Drop the word DATE here.  datex is already a date, so you don't need to
cast it, and if you did need to cast it this would be the wrong syntax
anyway.  DATE 'foo' is only appropriate syntax for a simple literal
constant 'foo'.

            regards, tom lane

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

Предыдущее
От: Atif Jung
Дата:
Сообщение: PSQL
Следующее
От: Greg
Дата:
Сообщение: Data type OIDs