Re: difference between current_timestamp and now() in quotes

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: difference between current_timestamp and now() in quotes
Дата
Msg-id 200901220920.45452.aklaver@comcast.net
обсуждение исходный текст
Ответ на Re: difference between current_timestamp and now() in quotes  (Jason Long <mailing.list@supernovasoftware.com>)
Список pgsql-general
On Thursday 22 January 2009 9:07:37 am Jason Long wrote:
> Adrian Klaver wrote:
> > On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote:
> >> Grzegorz Jaśkiewicz escribió:
> >>> test2=# insert into dupa(a) select 'current_timestamp' from
> >>> generate_series(1,100);
> >>> ERROR:  date/time value "current" is no longer supported
> >>> LINE 1: insert into dupa(a) select 'current_timestamp' from generate...
> >>>                                    ^
> >>> test2=# insert into dupa(a) select 'now()' from generate_series(1,100);
> >>> INSERT 0 100
> >>>
> >>>
> >>> Any ideas why the difference ?
> >>
> >> The parser handles CURRENT_TIMESTAMP (and others) specially, and doesn't
> >> recognize it in quotes.  I don't know why 'now()' works; I think it is a
> >> literal of type unknown.  I guess it's expanded to the actual value in
> >> later parsing stages.
> >>
> >> --
> >> Alvaro Herrera
> >> http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom
> >> Development, 24x7 support
> >
> > At least on 8.2  'now()' does not work either at least not in the way I
> > think you want. I get:
> >
> > test=# SELECT 'now()';
> >  ?column?
> > ----------
> >  now()
> > (1 row)
>
> Try
> select now();

Yes that is how I use it :) My example referred to the original message that
said select 'now()' worked but 'current_timestamp' did not.


--
Adrian Klaver
aklaver@comcast.net

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

Предыдущее
От: Jason Long
Дата:
Сообщение: Re: difference between current_timestamp and now() in quotes
Следующее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: difference between current_timestamp and now() in quotes