Re: Simple search question

From: newsuser(at)linux2(dot)johnmckown(dot)net (John McKown)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Simple search question
Date: 2000-06-13 10:59:13
Message-ID: slrn8kc501.54l.newsuser@linux2.johnmckown.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, 13 Jun 2000 12:15:17 +1000, Alex <gliathit(at)ihug(dot)com(dot)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).

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Dixon 2000-06-13 11:25:09 Re: Simple search question
Previous Message Jan Wieck 2000-06-13 09:58:13 Re: sql foregein key