curval was Re: is PG able to handle a >500 GB Database?

From: "rob" <rob(at)cabrion(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-general(at)postgresql(dot)org>
Subject: curval was Re: is PG able to handle a >500 GB Database?
Date: 2001-01-21 02:22:00
Message-ID: 000801c08350$f10b3600$4100fd0a@cabrion.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I just read this again. On the first read I thought last_value would give
what was in the current backend and not "someone else's". When I read it
the second time last_value is actually the behavior I wanted for that
program I described. Sorry to be so dense.

On a different note. OID's are not guaranteed to be unique within a table?

--rob

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "rob" <rob(at)cabrion(dot)com>
Cc: "Florent Guillaume" <efgeor(at)noos(dot)fr>; "Oliver Elphick"
<olly(at)lfix(dot)co(dot)uk>; <pgsql-general(at)postgresql(dot)org>
Sent: Saturday, January 20, 2001 11:22 AM
Subject: Re: Re: Re: is PG able to handle a >500 GB Database?

> "rob" <rob(at)cabrion(dot)com> writes:
> > currval returns error unless nextval has been called at least once in
the
> > session.
>
> > I use <seq>.last_value
>
> > Perhaps I'm fooling myself
>
> Yes, you are, unless you never have more than one client attached to
> your database. last_value will return whatever value was last assigned
> by any backend, therefore you might not get the value that was inserted
> into your tuple, but someone else's.
>
> The point about currval being initially undefined seems moot if what
> you're using it for is to recover the serial number that was assigned to
> a tuple you just inserted ...
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-21 02:49:29 Re: curval was Re: is PG able to handle a >500 GB Database?
Previous Message Vince Vielhaber 2001-01-20 23:54:32 Re: Re: couple of general questions