Re: How to get CURRENT_DATE in a pl/pgSQL function

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: How to get CURRENT_DATE in a pl/pgSQL function
Дата
Msg-id AANLkTimTUkyiFR0-o90bTmRHwK3T13mZTgyOu3m-gYMH@mail.gmail.com
обсуждение исходный текст
Ответ на How to get CURRENT_DATE in a pl/pgSQL function  (Kenneth Marshall <ktm@rice.edu>)
Ответы Re: How to get CURRENT_DATE in a pl/pgSQL function  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: How to get CURRENT_DATE in a pl/pgSQL function  (Kenneth Marshall <ktm@rice.edu>)
Список pgsql-sql
On Tue, May 18, 2010 at 12:08 PM, Kenneth Marshall <ktm@rice.edu> wrote:

> http://www.postgresql.org/docs/8.4/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
>
> you can use CURRENT_DATE. When I try to use it in
> the following pl/pgSQL function it gives the error:

> BEGIN
>    curtime := 'CURRENT_DATE';
>    LOOP


I'm not "up" on my pl/pgSQL, but isn't CURRENT_DATE a literal value so
it shouldn't to be enclosed in single quotes?

Another idea would be to:  CAST( now() AS DATE )



--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


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

Предыдущее
От: Kenneth Marshall
Дата:
Сообщение: How to get CURRENT_DATE in a pl/pgSQL function
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: How to get CURRENT_DATE in a pl/pgSQL function