Skip site navigation (1) Skip section navigation (2)

pgsql: Fix a couple of contrib/dblink bugs.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix a couple of contrib/dblink bugs.
Date: 2012-04-04 00:44:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Fix a couple of contrib/dblink bugs.

dblink_exec leaked temporary database connections if any error occurred
after connection setup, for example
	SELECT dblink_exec('...connect string...', 'select 1/0');
Add a PG_TRY block to ensure PQfinish gets done when it is needed.
(dblink_record_internal is on the hairy edge of needing similar treatment,
but seems not to be actively broken at the moment.)

Also, in 9.0 and up, only one of the three functions using tuplestore
return mode was properly checking that the query context would allow
a tuplestore result.

Noted while reviewing dblink patch.  Back-patch to all supported branches.



Modified Files
contrib/dblink/dblink.c |   24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-04-04 19:06:32
Subject: pgsql: Fix syslogger to not lose log coherency under high load.
Previous:From: Robert HaasDate: 2012-04-03 12:39:29
Subject: pgsql: Arrange for on_exit_nicely to be thread-safe.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group