Andy Colson <andy(at)squeakycode(dot)net> 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/postgres/sql-keywords-appendix.html
Older versions of plpgsql didn't have quite the same rules about
reserved words as the main SQL parser. In 9.0 the rules are much
more nearly the same; in particular, unquoted use of reserved words
won't work.
regards, tom lane