On Fri, Jun 17, 2005 at 09:37:23AM -0700, Matt Iskra wrote:
>
> CREATE FUNCTION
> oc.upd_last_touch()
> RETURNS TRIGGER AS
> $upd_last_touch$
> BEGIN
> NEW.last_touch := current_timestamp;
> RETURN NEW;
> END;
> $upd_last_touch$
> LANGUAGE 'plpgsql' VOLATILE;
>
> However, PostgreSQL is STILL giving me a syntex error on line two
> of the above function. The exact text is:
>
> ERROR: syntax error at or near "FUNCTION" at character 16.
I created an oc schema and used psql to copy the above code into a
database with no problems. Have you tried using psql instead of
pgAdmin III?
In the image you attached, there's a marker on the left side of the
line that contains oc.upd_last_touch(), and it looks like the cursor
is just after the dot. Are those significant, perhaps showing where
the problem is? I don't use pgAdmin III -- does it have trouble
with schema-qualified function names? What happens if you omit
"oc." and make the function name simply upd_last_touch?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/