Re: [HACKERS] Oid Questions - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Oid Questions
Date
Msg-id 199801222234.RAA16386@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Oid Questions  (Zeev Suraski <bourbon@netvision.net.il>)
List 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 by date:

Previous
From: Zeev Suraski
Date:
Subject: Re: [HACKERS] Oid Questions
Next
From: The Hermit Hacker
Date:
Subject: Important Announcement