pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: cgg007@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: undefine currval()
Date: Tue, 9 Sep 2003 07:13:56 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com> (raw)
In-Reply-To: <9434.1063064123@sss.pgh.pa.us>

On Mon, 8 Sep 2003, Tom Lane wrote:

> "scott.marlowe" <scott.marlowe@ihs.com> writes:
> > On Mon, 8 Sep 2003, Bruce Momjian wrote:
> >> I don't know how you could have an application that doesn't know if it
> >> has issued a nextval() in the current connection. Unless you can explain
> >> that, we have no intention of playing tricks with currval() for
> >> connection pooling.
> 
> > Actually, I would think the very act of using connection pooling would 
> > ensure that applications may well not know whether or not a nextval had 
> > been called.
> 
> The point is that it's not very sensible to be using currval except
> immediately after a nextval --- usually in the same transaction, I would
> think.

I'm pretty sure my second paragraph agreed with you on that.

>  Certainly, not resetting currval implies that there is
> *potential* coupling between different transactions that happen to share
> a connection.  But ISTM that such coupling would represent a bug in the
> application.

And that one too.

> Chris said he was using currval being undefined to know that no rows
> were inserted, but this seems less than compelling to me (why not look
> at the results of the insert commands you used?).  I'd support adding a
> currval-reset feature if someone can make a more compelling argument why
> a connection-pooling application would need it.

I'd say that if someone is looking at that, it would be better to have 
some kind of reset_connection call that makes a connection look like you 
just established it.

Bit I'd never use it.




view thread (7+ messages)

Message-ID: <Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@ihs.com, tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, cgg007@yahoo.com
  Subject: Re: undefine currval()
  In-Reply-To: <Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com>
  References: <9434.1063064123@sss.pgh.pa.us> <Pine.LNX.4.33.0309090709550.13569-100000@css120.ihs.com>

* 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