PGsql function timestamp issue

From: ng <pipelines(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: PGsql function timestamp issue
Date: 2014-05-29 20:46:59
Message-ID: CAAQKod115J-w7hiJ+rG8kn2FVqW51+ZVJsVpELNcU1Q4cw69dQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jonathan S. Katz 2014-05-29 20:52:32 Re: PGsql function timestamp issue
Previous Message Gary Stainburn 2014-05-28 11:24:36 Three way foreign keys