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

Поиск
Список
Период
Сортировка
От Brian Modra
Тема Re: How to get CURRENT_DATE in a pl/pgSQL function
Дата
Msg-id AANLkTinOFwZPnQGpNqBuOOz2_BgvVr50MK3BYHqEJX-K@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to get CURRENT_DATE in a pl/pgSQL function  (Tim Landscheidt <tim@tim-landscheidt.de>)
Список pgsql-sql
On 19/05/2010, Tim Landscheidt <tim@tim-landscheidt.de> wrote:
> Kenneth Marshall <ktm@rice.edu> wrote:
>
>> It works using 'now' and I assume that since curtime is
>> of type DATE that the assignment casts the return automatically
>> to type DATE. Thank you for the ideas.
>> [...]
>
> What's wrong with Pavel's correct and to-the-point answer?

No need actually to cast... just use current_date without the quotes.
Its not a string.

>
> Tim
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>


-- 
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/


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

Предыдущее
От: Tim Landscheidt
Дата:
Сообщение: Re: How to get CURRENT_DATE in a pl/pgSQL function
Следующее
От: silly sad
Дата:
Сообщение: Re: plperlu user function.