Last inserted row id with complex PK

From: Nelson Green <nelsongreen84(at)gmail(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Last inserted row id with complex PK
Date: 2014-01-08 15:54:37
Message-ID: CAGo-KZkErWMrRutaBP8TGQUfCCYi_bnqfvwoomqZqUGCD9z4bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a projects log table with a three column PK, project_num,
person_num, and sequence, where each new entry for a project/person
combination increments the sequence, which is not an auto incrementing
sequence. Is there any way to retrieve the last entry to the table? For
instance, if the last entry for person 427 on project 15 was sequence
number 125, is that information available to me anywhere?

Thanks,
Nelson

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2014-01-08 16:09:22 Re: Last inserted row id with complex PK
Previous Message gator_ml 2014-01-08 15:09:13 Re: Consistent file-level backup of pg data directory