pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Goldberg <josh@4dmatrix.com>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Michael Kovalcik <makd32@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How do I select the last Id in a column???
Date: Fri, 27 Jun 2003 10:06:41 -0700
Message-ID: <02a101c33cce$7af916a0$6e02a8c0@4dmatrix.com> (raw)
References: <20030623184706.75021.qmail@web11101.mail.yahoo.com>
	<01f401c33c25$fbffd5d0$6e02a8c0@4dmatrix.com>
	<20030626233001.GA11420@wolff.to>

What could cause a table to act serialized when read committed transactions
are set in the configuration?  That is something I am running into, which
provoked my [incorrect] example.

From: "Bruno Wolff III" <bruno@wolff.to>
Sent: Thursday, June 26, 2003 4:30 PM
> On Thu, Jun 26, 2003 at 14:00:33 -0700,
>   Josh Goldberg <josh@4dmatrix.com> wrote:
> > to get the last record inserted just
> > select * from row order by autoincId desc limit 1;
> >
> > if you have several clients doing this you might want to put your insert
and
> > the select inside a transaction.
>
> That won't help. Your suggestion will only work in serializable
transactions.
>
> In read committed mode the select might see a value for autoincId from
> a transaction that committed between the insert and the select.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>




view thread (13+ messages)  latest in thread

Message-ID: <02a101c33cce$7af916a0$6e02a8c0@4dmatrix.com>
Permalink:  ../02a101c33cce$7af916a0$6e02a8c0@4dmatrix.com/
Also on:    postgresql.org/message-id/02a101c33cce$7af916a0$6e02a8c0@4dmatrix.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-admin@postgresql.org
  Cc: josh@4dmatrix.com, bruno@wolff.to, makd32@yahoo.com
  Subject: Re: How do I select the last Id in a column???
  In-Reply-To: <02a101c33cce$7af916a0$6e02a8c0@4dmatrix.com>
  References: <20030623184706.75021.qmail@web11101.mail.yahoo.com> <01f401c33c25$fbffd5d0$6e02a8c0@4dmatrix.com> <20030626233001.GA11420@wolff.to> <02a101c33cce$7af916a0$6e02a8c0@4dmatrix.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