X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8254947592C for ; Tue, 1 Apr 2003 23:36:57 -0500 (EST) Received: from mars-hq (dsl231-057-057.sea1.dsl.speakeasy.net [216.231.57.57]) by postgresql.org (Postfix) with SMTP id 38A0A4758C9 for ; Tue, 1 Apr 2003 23:36:53 -0500 (EST) Received: (qmail 3395 invoked from network); 1 Apr 2003 21:55:35 -0000 Received: from unknown (HELO mars-hq.com) (10.0.0.3) by dsl231-057-057.sea1.dsl.speakeasy.net with SMTP; 1 Apr 2003 21:55:35 -0000 Date: Tue, 1 Apr 2003 20:37:03 -0800 Mime-Version: 1.0 (Apple Message framework v551) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: pesky plpgsql From: Walter McGinnis To: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.551) X-Spam-Status: No, hits=-8.9 required=5.0 tests=BAYES_10,USER_AGENT_APPLEMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/18 X-Sequence-Number: 12719 Guess I'm an April Fool. When I define the following psql returns "CREATE": -- update all galleries that are categories with their skey and rkey values CREATE FUNCTION update_cat_keys() RETURNS integer AS ' declare v_row RECORD; begin for v_row in select gallery_id, imagedb_gallery_hierarchy_skey(gallery_id, NULL, '''') as skey, imagedb_gallery_hierarchy_rskey(gallery_id, NULL, '''') as rskey from imagedb_galleries where category_p = ''t'' loop update imagedb_galleries set skey = v_row.skey, rskey = v_row.rskey where gallery_id = v_row.gallery_id; end loop; return 1; end; ' LANGUAGE 'plpgsql'; When I call the function I get the following error: devpps=# select update_cat_keys(); NOTICE: plpgsql: ERROR during compile of update_cat_keys near line 2 ERROR: parse error at or near ";" The select in the loop runs fine in psql. So I'm stumped... I'm pretty ignorant about plpgsql, I'm used to pl/sql. TIA, Walter