Re: pg_query & pg_last_oid

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: pg_query & pg_last_oid
Дата
Msg-id 20020818231602.B19841@svana.org
обсуждение исходный текст
Ответ на pg_query & pg_last_oid  ("Ben-Nes Michael" <miki@canaan.co.il>)
Список pgsql-general
I don't beleive so, since the last oid is specifically tied to the last
query you executed. Ofcourse, if you insert multiple rows at the same time,
you don't get any oid at all.

Or you could use nextval/currval and get clearly defined semantics which are
guarenteed to work in the future.

(What would pg_last_oid return on a table that doesn't have oids?)

On Fri, Aug 16, 2002 at 10:44:13AM +0200, Ben-Nes Michael wrote:
> Hi All
>
> In PHP
>
> after sending a querry Im using pg_last_oid to get the oid.
>
> Is a mix between two users that submit query simultaniusly accour ?
>
> user A: insert into .......
> user A: last oid 1
> user B: insert into .......
> user B: last oid 2
>
> user A: pg_last_oid  = 2
> user B: pg_last_oid  = 2
>
> Can this happen ?
> If so, what one can do to avoid it ?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvar Freude
Дата:
Сообщение: BYTEA, indexes and "like"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: cube_contains and indexing