PQprepare result

Started by Igor Korot3 months ago2 messagesgeneral
Jump to latest
#1Igor Korot
ikorot01@gmail.com

Hi, ALL,

[code]
PGresult *res = PQprepare( m_db, "query1", ... );
PQclear( res );
res = PQprepare( m_db, "query2", ....);
PQclear( res );
[/code]

I presume that it is safe to do the code like this
(re-using the PGresult variable).

Or I have to use its own PGresult for each PQprepare
call?

Thank you.

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Igor Korot (#1)
Re: PQprepare result

On 29 Dec 2025, at 22:14, Igor Korot <ikorot01@gmail.com> wrote:

I presume that it is safe to do the code like this
(re-using the PGresult variable).

That's correct.

--
Daniel Gustafsson