New problem with SET/autocommit - Mailing list pgsql-hackers

From Bruce Momjian
Subject New problem with SET/autocommit
Date
Msg-id 200210200440.g9K4eKr03296@candle.pha.pa.us
Whole thread Raw
Responses Re: New problem with SET/autocommit  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Remember how we make SET/SHOW/RESET _not_ be part of a multi-statement
> transaction when it is at the start of a transaction and autocommit is
> off?
> 
> Well, look at this:
>         
>         test=> SET random_page_cost = 2;
>         SET
>         test=> COMMIT;
>         WARNING:  COMMIT: no transaction in progress
>         COMMIT
> 
> The WARNING happens with SHOW and RESET too.  I wonder if we should
> suppress the WARNING of a COMMIT with no statements when autocommit is
> off.  This will probably be better for portability, though again, it is
> confusing.

[ Sorry, I deleted Tom's reply.]

Tom, you mentioned suppressing the WARNING on COMMIT of an empty
transaction would make it hard to know when you are in a transaction,
but I was suggesting suppressing the warning only when autocommit was
off, so by definition you are always in a transaction, sort of.  You are
in a transaction, but perhaps an empty one.  Should it be OK to issue a
COMMIT of an empty transaction when autocommit is off?

--  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,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: DBD::PG - any works to be compatile with 7.3 ?
Next
From: Bruce Momjian
Date:
Subject: Re: DBD::PG - any works to be compatile with 7.3 ?