Re: last entry - Mailing list pgsql-general

From Ian Harding
Subject Re: last entry
Date
Msg-id sd5cbb07.092@mail.tpchd.org
Whole thread Raw
In response to last entry  (mixo <mixo@beth.uniforum.org.za>)
List pgsql-general
If you mean the value of the primary key (if a sequence is used) the way to do that is (in the same connection) to
issuea "select currval('sequencename')" which will return the last used value of that sequence within the current
connection.

If you mean the OID, there is a way to do that too, but I don't use them for ID so I don't know.

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org

We have only two things to worry about:  That things will never get
back to normal, and that they already have.


>>> mixo <mixo@beth.uniforum.org.za> 08/16/02 01:33AM >>>

Is it possible to identify the last entry that has been just insterted
into a table?



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Triggers
Next
From:
Date:
Subject: Re: Seq scan