Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6P93lf13272; Wed, 25 Jul 2001 05:03:48 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 2.12 #1) id 15PKZt-000P7D-0W; Wed, 25 Jul 2001 10:03:37 +0100 Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 5896315067; Wed, 25 Jul 2001 09:57:44 +0100 (BST) Message-ID: <009301c114e7$dd2e8960$1001a8c0@archonet.com> From: "Richard Huxton" To: , , "Morgan Curley" References: <4.3.2.7.2.20010725030649.024f7de8@e4media.com> Subject: Re: Inserts in triggers Date: Wed, 25 Jul 2001 09:56:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200107/900 X-Sequence-Number: 13020 From: "Morgan Curley" > Are there server setting that need to be set in order to do inserts from > trigger functions? Don't think so. Triggers run with the permissions of the creator, not the caller though so you might want to look into that. > I keep getting: ERROR: parser: parse error at or near "$1" > and the DEBUG log entry points to the line with the insert on it. > i.e. Could you quote a few lines of code either side - especially something with the $1 > INSERT events ( event_id, sport_id ,name ,feed_code, start_time, > active_flag, create_timestamp, update_timestamp ) VALUES ( event_id > ,sport_id ,feed_code ,feed_code, create_timestamp, 1, create_timestamp, > create_timestamp ); > > where the values list is a list of predefined vars. Well it should be INSERT INTO ... but I presume this is a cut & paste issue. So you have variable names the same as all the field names? I'd probably change them (stick v_ on the front or something). Even if plpgsql doesn't get confused readers will. - Richard Huxton