X-Original-To: pgsql-hackers@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DD0A2474E44 for ; Fri, 21 Mar 2003 11:11:13 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2LGBFub013359; Fri, 21 Mar 2003 11:11:15 -0500 (EST) To: Bruce Momjian Cc: Dave Cramer , PostgreSQL Development Subject: Re: Roadmap for FE/BE protocol redesign In-reply-to: <200303211554.h2LFsIf29529@candle.pha.pa.us> References: <200303211554.h2LFsIf29529@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 21 Mar 2003 10:54:18 -0500" Date: Fri, 21 Mar 2003 11:11:15 -0500 Message-ID: <13358.1048263075@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/917 X-Sequence-Number: 37163 Bruce Momjian writes: > What I was wondering is if we could create a currval() call that takes > no arguments, and returns the most recent sequence id assigned. Why? That's still an extra query that the client has to issue, and currval in that form would be an amazingly fragile programming tool. (What if some trigger causes an autoincrement on some other sequence than the one you are thinking about?) I liked the INSERT ... RETURNING and UPDATE ... RETURNING syntax extensions that Philip Warner (IIRC) proposed awhile back. Those would get the job done much more flexibly than anything else that's been suggested. That's why I think it's a language problem and not a protocol problem. regards, tom lane