Alan Simon <simon@hslc.org> writes:
> -- Import copy_note data
> CREATE OR REPLACE FUNCTION add_copy_notes() RETURNS integer AS '
> DECLARE
> copynote RECORD;
> BEGIN;
> FOR copynote IN SELECT * FROM asset.copy ac
One fairly common gotcha is that you can't put a semicolon directly
after BEGIN ...
> psql:generate_notes.sql:26: ERROR: syntax error at or near "RECORD"
> LINE 3: copy RECORD;
> ^
... although this error message suggests there's something else wrong in
the immediate vicinity. But since what that shows doesn't match up with
what you show above, I wonder whether you're confusing yourself by
editing the wrong file. We've all done it :-(
regards, tom lane