PQclear question...

Started by Tim Barnardalmost 25 years ago3 messagesgeneral
Jump to latest
#1Tim Barnard
tbarnard@povn.com

Is it necessary to call PQclear if a query that
would normally return tuples fails? What if the
query returns 0 tuples? In other words, is it
only necessary to call it if you get back one
or more tuples?

Tim

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tim Barnard (#1)
Re: PQclear question...

"Tim Barnard" <tbarnard@povn.com> writes:

Is it necessary to call PQclear if a query that
would normally return tuples fails?

If you got a non-NULL result from PQexec, you'd better PQclear it,
or suffer the consequences (memory leak -> eventual application crash).

regards, tom lane

#3Tim Barnard
tbarnard@povn.com
In reply to: Tim Barnard (#1)
Re: PQclear question...

Thanks.

Tim

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Tim Barnard" <tbarnard@povn.com>
Cc: <pgsql-general@postgresql.org>
Sent: Tuesday, May 29, 2001 3:30 PM
Subject: Re: [GENERAL] PQclear question...

Show quoted text

"Tim Barnard" <tbarnard@povn.com> writes:

Is it necessary to call PQclear if a query that
would normally return tuples fails?

If you got a non-NULL result from PQexec, you'd better PQclear it,
or suffer the consequences (memory leak -> eventual application crash).

regards, tom lane