note 8188 deleted from function.pg-getlastoid by jimw
| From: | jimw@php.net | Date: | Fri, 07 Dec 2001 21:33:38 +0000 |
| Subject: | note 8188 deleted from function.pg-getlastoid by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22032@lists.php.net to get a copy of this message | ||
This is great for tables that use sequences to create a unique record ID ...
It turns out all PostgreSQL tables have a hidden column "oid" that holds a unique
identifier. This function allows you to find out what OID was assigned to the last record you
INSERTed, allowing to fetch the last record you inserted by using it's OID (I'm doing this
to find out what value was assigned to a column from a sequence for instance).
Of course now that I know this, maybe I could've used the OID's from the bennning,
avoiding the seuqences all together ! Ah well, lesson learned :)
J.F.