Re: plpgsql extract epoch problem

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Darren Ferguson <darren(at)crystalballinc(dot)com>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql extract epoch problem
Date: 2003-10-22 17:40:01
Message-ID: 20031022174001.GA11907@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 22, 2003 at 12:50:22PM -0400, Darren Ferguson wrote:

> create or replace function test() returns integer as '
> declare
> _test timestamp with time zone;
> _f integer;
> begin
> _test := current_timestamp;
> _f := extract(epoch from timestamp _test);

Why not simply
_f := extract(epoch from _test);
?

> return _f;
> end;' language 'plpgsql';

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Hay que recordar que la existencia en el cosmos, y particularmente la
elaboración de civilizaciones dentre de él no son, por desgracia,
nada idílicas" (Ijon Tichy)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Nasser 2003-10-22 18:05:31 Re:
Previous Message Eric Dahnke 2003-10-22 17:37:02 Prepared Statements