Subject: PQprepare result

From: Igor Korot <[email-masked]>
Date: Mon, 29 Dec 2025 13:14:13 -0800

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.

---

From: Daniel Gustafsson <[email-masked]>
Date: Tue, 30 Dec 2025 09:24:30 +0100

> On 29 Dec 2025, at 22:14, Igor Korot <[email-masked]> wrote:

> (re-using the PGresult variable).

That's correct.

--
Daniel Gustafsson