Re: Simple search question
John McKown <newsuser@linux2.johnmckown.net>
From: newsuser@linux2.johnmckown.net (John McKown)
To: pgsql-sql@postgresql.org
Date: 2000-06-13T10:59:13Z
Lists: pgsql-sql
On Tue, 13 Jun 2000 12:15:17 +1000, Alex <gliathit@ihug.com.au> wrote: [snip] > >> so I can't test this. If it doesn't work, I'd try using pg_GetLastOid() >> to get the OID of the inserted row. The use the pg_Exec and SELECT >> * WHERE OID=oid-value, followed by pg_fetch_row(). > >Thanks John, and the other person that replied to my email (I know it is a >bit of a stupid question, but in such an unpopulated list, I don't think >there's any reason to post privately). > This leads to another question. If someone adds another row during this, >what will happen? From what I can tell, the function pg_GetLastOid() does not do a database query. It appears that it simply fetches a value which was returned by PostgreSQL during the pg_Exec() call. Therefore, there should not be any problem with another, concurrent, execution of this PHP script. The pg_GetLastOid() is really more of pg_GetLastOid_of_this_execution, not "global" to the database (not GetLastOid_of_the_entire_database).