PGsql function timestamp issue - Mailing list pgsql-sql

From ng
Subject PGsql function timestamp issue
Date
Msg-id CAAQKod115J-w7hiJ+rG8kn2FVqW51+ZVJsVpELNcU1Q4cw69dQ@mail.gmail.com
Whole thread Raw
Responses Re: PGsql function timestamp issue  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
Re: PGsql function timestamp issue  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: PGsql function timestamp issue  (Vinayak Pokale <vinpokale@gmail.com>)
List 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?

pgsql-sql by date:

Previous
From: Gary Stainburn
Date:
Subject: Three way foreign keys
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: PGsql function timestamp issue