Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0CF76476A83; Tue, 3 Sep 2002 11:00:54 -0400 (EDT) Received: from thread.crystalballinc.com (www.crystalballinc.com [63.89.89.77]) by postgresql.org (Postfix) with ESMTP id 93D8B4765FB; Tue, 3 Sep 2002 10:59:11 -0400 (EDT) Received: from localhost (darren@localhost) by thread.crystalballinc.com (8.11.6/8.9.3) with ESMTP id g83EuSb13795; Tue, 3 Sep 2002 10:56:28 -0400 Date: Tue, 3 Sep 2002 10:56:28 -0400 (EDT) From: Darren Ferguson To: Greg Patnude Cc: pgsql-general@postgresql.org, Subject: Re: Why must the function that a trigger calls return In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/88 X-Sequence-Number: 29669 What would the trigger return the value too. You did not call the trigger the system called the trigger. Also triggers are not meant for use in this way they are meant for data manipulation before or after a table is inserted,updated or deleted. You would have to run select currval('seq_name') as the next query. On Thu, 29 Aug 2002, Greg Patnude wrote: > This seem rather limiting... Suppose I want a trigger that after insert, > returns the currval(sequence) of the newly inserted row automatically > without having to run another query ??? > > GP > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Darren Ferguson