Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA83831 for ; Tue, 4 May 1999 12:12:56 -0400 (EDT) (envelope-from prlw1@newn.cam.ac.uk) Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk) by henry.newn.cam.ac.uk with esmtp (Exim 2.12 #1) id 10ehnI-0004S1-00; Tue, 4 May 1999 17:11:40 +0100 Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1) id 10ehn8-0004bs-00; Tue, 4 May 1999 17:11:30 +0100 Subject: Re: [INTERFACES] sequences To: herouth@oumail.openu.ac.il (Herouth Maoz) Date: Tue, 4 May 1999 17:11:30 +0100 (BST) From: "Patrick Welche" Cc: pgsql-interfaces@postgresql.org Reply-To: prlw1@cam.ac.uk In-Reply-To: from "Herouth Maoz" at May 3, 99 02:57:54 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: Herouth Maoz wrote: > > At 22:41 +0300 on 29/04/1999, Jackson, DeJuan wrote: > > > > You might try placing the INSERT and SELECT CURRVAL into a transaction > > block. > > That shouldn't make a difference. Currval's scope is the entire session, > from the last call (or implicit call) to nextval to the next call. > > Now, let's see if I understand right: The query works well in psql, but not > in a program? So let me ask you this - do you run the program, perhaps, as > a different user, such as the httpd or nobody user? If so, you need to > GRANT SELECT on the sequence to be able to use the currval function. Thank you!! That was it. (I had granted access to tables, not to sequences) Cheers, Patrick