Re: [HACKERS] Oid Questions

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Oid Questions
Дата
Msg-id 199801222234.RAA16386@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Oid Questions  (Zeev Suraski <bourbon@netvision.net.il>)
Список pgsql-hackers
>
> I'll try to rephrase the question without taking 3 complex paragraphs to do
> that :)
>
> Is there a way to know a PostgresSQL result holds NO interesting
> information (no rows, no oids, no nothing)?
>
> The more I think of it, the more it seems like this isn't the case with
> PostgresSQL.  Moreover, it seems like in most cases the result holds one
> interesting tidbit of information or another.  When I wrote the MySQL
> module, basically, I made any query that did not return rows (not including
> select's that returned 0 rows) but succeeded return TRUE instead of a
> result handler, since there wasn't much point at keeping that result.  With
> MySQL the information about the last inserted id (mysql_insert_it(), I
> think it's comparable to the last oid in pgsql) and the number of affected
> rows can be obtained from the 'server' structure, and not the restul
> structure as it is with Postgres.
>
> I guess I'll change the Postgres module to always keep the result
> structures and return result identifiers on a successful query.

Yes, all the return information for results that return zero rows are in
the Result structure, so you can have multiple results open at the same
time, and query them separately.  They remain valid until PQclear()'ed.

--
Bruce Momjian
maillist@candle.pha.pa.us

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

Предыдущее
От: Zeev Suraski
Дата:
Сообщение: Re: [HACKERS] Oid Questions
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Important Announcement