From: Tom Lane <tgl@sss.pgh.pa.us>
To: ow <oneway_111@yahoo.com>
Cc: Achilleus Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: currval() without specifying the sequence name
Date: Tue, 09 Mar 2004 11:10:40 -0500
Message-ID: <25738.1078848640@sss.pgh.pa.us> (raw)
In-Reply-To: <20040309145359.79236.qmail@web60805.mail.yahoo.com>
References: <20040309145359.79236.qmail@web60805.mail.yahoo.com>
ow <oneway_111@yahoo.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, oneway_111@yahoo.com, achill@matrix.gatewaynet.com
Subject: Re: currval() without specifying the sequence name
In-Reply-To: <25738.1078848640@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox