Re: [GENERAL] Postgres 9 alpha 5 revised, stored proc

2010-04-07 Thread Andy Colson
On 04/07/2010 08:34 PM, Tom Lane wrote: Andy Colson writes: I have this stored proc that works in pg 8.4. create or replace function roundts(ts timestamp) returns timestamp as $$ declare tmp integer; result timestamp; offset interval; OFFSET is a reserved word: http://

Re: [GENERAL] Postgres 9 alpha 5 revised, stored proc

2010-04-07 Thread Tom Lane
Andy Colson writes: > I have this stored proc that works in pg 8.4. > create or replace function roundts(ts timestamp) returns timestamp as $$ > declare > tmp integer; > result timestamp; > offset interval; OFFSET is a reserved word: http://developer.postgresql.org/pgdocs/postgr

[GENERAL] Postgres 9 alpha 5 revised, stored proc

2010-04-07 Thread Andy Colson
I have this stored proc that works in pg 8.4. create or replace function roundts(ts timestamp) returns timestamp as $$ declare tmp integer; result timestamp; offset interval; begin tmp := extract(second from ts); if tmp > 30 then tmp := 60