Re: Last inserted row id with complex PK

From: Nelson Green <nelsongreen84(at)gmail(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Last inserted row id with complex PK
Date: 2014-01-08 21:48:25
Message-ID: CAGo-KZ=r9J-WD_1z9mgnJGMvrK-bd2=rkMdnxZmDJA74UWMf6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 8, 2014 at 1:24 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:

> Nelson Green wrote
> > My apologies, I was not completely clear. I will not know any of the
> > columns in advance. The most recent insert is the result of user input
> > from
> > a web form, so I won't know what project or what user generated the last
> > insert. That was why I wandered if that information was stored anywhere
> in
> > the system.
>
> I'd probably add either (or both) a table-level auto-sequence field and a
> "recordcreationdate" default timestamptz field.
>

Yeah, default timestamp was the best solution I could come up with, but I
was hoping there was a way to access the actual PK of the most recent
insert.
Looks like timestamp it is.

Thanks everyone!

> David J.
>
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/Last-inserted-row-id-with-complex-PK-tp5785863p5785901.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marco Baringer 2014-01-08 21:50:34 getting domain information from query results
Previous Message David Johnston 2014-01-08 19:24:02 Re: Last inserted row id with complex PK