Re: PGsql function timestamp issue

Поиск
Список
Период
Сортировка
От Jonathan S. Katz
Тема Re: PGsql function timestamp issue
Дата
Msg-id A7B82A97-96B4-4ED2-8F2E-FDED9C6F19EC@excoventures.com
обсуждение исходный текст
Ответ на PGsql function timestamp issue  (ng <pipelines@gmail.com>)
Список pgsql-sql
On May 29, 2014, at 4:46 PM, ng <pipelines@gmail.com> wrote:

create or replace function dw.fx_nish()
returns text
  language plpgsql
  as
$$
declare
x timestamp with time zone;
y timestamp with time zone;
begin
x:= current_timestamp;
perform pg_sleep(5);
y:= current_timestamp;
if x=y then
return 'SAME';
else
return 'DIFFERENT';
end if;

end;
$$


select dw.fx_nish()
This give me 'SAME'

Any work around for this?

Check out the Current Date/Time section:


You probably want "clock_timestamp()" depending on what you are trying to accomplish.

Jonathan

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

Предыдущее
От: ng
Дата:
Сообщение: PGsql function timestamp issue
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: PGsql function timestamp issue