Re: [GENERAL] plpgsql - TIMESTAMP variables in EXTRACT

2005-06-15 Thread Matthew Phillips
Stephan, Thanks, this does work. I assume that the usage of 'TIMESTAMP' only applies when a literal representation of the date is given. Matthew Stephan Szabo wrote: On Wed, 15 Jun 2005, Matthew Phillips wrote: Hi all, I have the following in a plpgsql proc on 7.3.4: DECLARE ... curTime T

Re: [GENERAL] plpgsql - TIMESTAMP variables in EXTRACT

2005-06-15 Thread Stephan Szabo
On Wed, 15 Jun 2005, Matthew Phillips wrote: > Hi all, > > I have the following in a plpgsql proc on 7.3.4: > > > DECLARE > ... > curTime TIMESTAMP; > ppsCnt INT; > > BEGIN > ... > > -- this works > SELECT INTO curTime localtimestamp; > > -- get unix seconds from current time (doesn't work) > SE

[GENERAL] plpgsql - TIMESTAMP variables in EXTRACT

2005-06-15 Thread Matthew Phillips
Hi all, I have the following in a plpgsql proc on 7.3.4: DECLARE ... curTime TIMESTAMP; ppsCnt INT; BEGIN ... -- this works SELECT INTO curTime localtimestamp; -- get unix seconds from current time (doesn't work) SELECT INTO ppsCnt EXTRACT (EPOCH FROM TIMESTAMP curTime ); -- p