Re: Two TIMESTAMPs in one pl/sql function

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Two TIMESTAMPs in one pl/sql function
Дата
Msg-id 200211261524.06002.dev@archonet.com
обсуждение исходный текст
Ответ на Two TIMESTAMPs in one pl/sql function  ("Rison, Stuart" <srison@rvc.ac.uk>)
Список pgsql-sql
On Tuesday 26 Nov 2002 1:54 pm, Rison, Stuart wrote:
> Hi,
>
> I'm trying to time a pl/sql function using a rougn and ready method,
> basically: print a TIMESTAMP at the begining of the function, print a
> TIMESTAMP at the end of the function.
[snip]
> Gives me:
>
> testdb2=# select timer();
> NOTICE:  Start: 2002-11-26 13:40:14.116605+00
> NOTICE:  End: 2002-11-26 13:40:14.116605+00

> I've tried all sorts of variations but I hit one of two problems; either
> the TIMESTAMP is fixed to the function compile time or, as above, the
> timer1 and timer2 TIMESTAMPs are always identical.

Try timeofday() not now(). Quite often you want the time to stay fixed for the
length of a transaction (what now() does). In this case you don't - see the
Functions : date/time section of the manual for details.

--  Richard Huxton


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: help on sql query
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: SQL -select count-