Fixes for autocommit = off

Started by Bruce Momjianalmost 24 years ago3 messagespatches
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Here are some patches I applied that attempt to fix some of our
utilities for the 'autocommit = off' world. I still need to do more
work.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+74-63
#2Joe Conway
mail@joeconway.com
In reply to: Bruce Momjian (#1)
Re: Fixes for autocommit = off

Bruce Momjian wrote:

Here are some patches I applied that attempt to fix some of our
utilities for the 'autocommit = off' world. I still need to do more
work.

Speaking of autocommit = off, I was contemplating sending in a patch for
dblink with this in it:

appendStringInfo(str,
"BEGIN;SET autocommit='on';COMMIT; %s",
GET_STR(PG_GETARG_TEXT_P(1)));

(where arg 1 is the user provided sql statement) to cover the non-persistent
connection case for dblink_exec. Is this the recommended client fix?

Joe

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#2)
Re: Fixes for autocommit = off

Joe Conway <mail@joeconway.com> writes:

Speaking of autocommit = off, I was contemplating sending in a patch for
dblink with this in it:
appendStringInfo(str,
"BEGIN;SET autocommit='on';COMMIT; %s",
GET_STR(PG_GETARG_TEXT_P(1)));
(where arg 1 is the user provided sql statement) to cover the non-persistent
connection case for dblink_exec. Is this the recommended client fix?

You do not need the begin/commit here.

A bigger question is why dblink should be doing that at all... seems
like it should be the programmer's responsibility.

regards, tom lane