X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 67981D1B9AF for ; Tue, 9 Mar 2004 16:11:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 78022-02 for ; Tue, 9 Mar 2004 12:10:51 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 778DDD1B979 for ; Tue, 9 Mar 2004 12:10:50 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i29GAe0X025739; Tue, 9 Mar 2004 11:10:41 -0500 (EST) To: ow Cc: Achilleus Mantzios , pgsql-sql@postgresql.org Subject: Re: currval() without specifying the sequence name In-reply-to: <20040309145359.79236.qmail@web60805.mail.yahoo.com> References: <20040309145359.79236.qmail@web60805.mail.yahoo.com> Comments: In-reply-to ow message dated "Tue, 09 Mar 2004 06:53:59 -0800" Date: Tue, 09 Mar 2004 11:10:40 -0500 Message-ID: <25738.1078848640@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/87 X-Sequence-Number: 17186 ow writes: > I guess I could but then: > 1) I'd still have to know the sequence name. When integrating pgSql > with 3party frameworks I'd either have to pass it there (could be a > very difficult task) or make some assumptions (also not very good). This scenario is really entirely ridiculous. You want your code to be integrated with other code and not make any assumptions, but you are willing to assume that only one sequence will be touched in any command, or that the last one that's touched is the one you want? It seems to me that this idea will render your code more fragile, not less so. > 3) If one sequence is used, in many cases it'll have to be of type int8 and > pgSql does not handle searches with int8 very nicely. Quote or cast and you're fine. But what does that have to do with knowing a sequence name? regards, tom lane