Thread: NOTICE: there is no transaction in progress

NOTICE: there is no transaction in progress

From
"Rodrick Hales"
Date:
We have two machines that run a C application that interfaces with a Postgres database.  They are our development and production machines.  The version is PostgreSQL 8.3.7 on i686-redhat-linux-gnu, complied by GCC gcc (GCC) 4.1.2.20071124 (Red Hat 4.1.2-42) . 
 
On the development machine,  I don't get notices and warnings related to Postgres SQL commands.  COMMIT and ABORT are likely the culprits.  On the production machine I do.  I understand these errors get sent to the 'stderr' stream by default.  I don't know which command exactly is causing the notices and warnings in the program and why the behavior is only happening on one machine.  Are there some settings on the database that have been set for displaying such warnings and notices?  Why does it happen one and not the other?  Any suggestions would be greatly appreciated.  Thanks.
 
Rodrick Hales
State Tax Commission
Office Of Information Technology
(601) 923.7427
rhales@mstc.state.ms.us

Re: NOTICE: there is no transaction in progress

From
John R Pierce
Date:
Rodrick Hales wrote:
> We have two machines that run a C application that interfaces with a
> Postgres database.  They are our development and production machines.
> The version is PostgreSQL 8.3.7 on i686-redhat-linux-gnu, complied by
> GCC gcc (GCC) 4.1.2.20071124 (Red Hat 4.1.2-42) .
>
> On the development machine,  I don't get notices and warnings
> related to Postgres SQL commands.  COMMIT and ABORT are likely the
> culprits.  On the production machine I do.  I understand these errors
> get sent to the 'stderr' stream by default.  I don't know which
> command exactly is causing the notices and warnings in the program and
> why the behavior is only happening on one machine.  Are there some
> settings on the database that have been set for displaying such
> warnings and notices?  Why does it happen one and not the other?  Any
> suggestions would be greatly appreciated.  Thanks.
>


logging is controlled by various settings in postgresql.conf



Re: NOTICE: there is no transaction in progress

From
Shoaib Mir
Date:
On Tue, Aug 11, 2009 at 2:51 AM, John R Pierce <pierce@hogranch.com> wrote:
Rodrick Hales wrote:
We have two machines that run a C application that interfaces with a Postgres database.  They are our development and production machines.  The version is PostgreSQL 8.3.7 on i686-redhat-linux-gnu, complied by GCC gcc (GCC) 4.1.2.20071124 (Red Hat 4.1.2-42) .  On the development machine,  I don't get notices and warnings related to Postgres SQL commands.  COMMIT and ABORT are likely the culprits.  On the production machine I do.  I understand these errors get sent to the 'stderr' stream by default.  I don't know which command exactly is causing the notices and warnings in the program and why the behavior is only happening on one machine.  Are there some settings on the database that have been set for displaying such warnings and notices?  Why does it happen one and not the other?  Any suggestions would be greatly appreciated.  Thanks.
 


logging is controlled by various settings in postgresql.conf

Best is to go through the manual at --> http://www.postgresql.org/docs/8.3/static/runtime-config-logging.html

and then take a difference of settings between the two.

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: NOTICE: there is no transaction in progress

From
Richard Huxton
Date:
Rodrick Hales wrote:
> We have two machines that run a C application that interfaces with a
> Postgres database.  They are our development and production machines.
> The version is PostgreSQL 8.3.7 on i686-redhat-linux-gnu, complied by
> GCC gcc (GCC) 4.1.2.20071124 (Red Hat 4.1.2-42) .
>
> On the development machine,  I don't get notices and warnings related
> to Postgres SQL commands.  COMMIT and ABORT are likely the culprits.
> On the production machine I do.

The message you mention would be to a COMMIT/ROLLBACK being issued
without a BEGIN. I think the setting you are after is probably
client_min_messages (ch 18 of the manuals). One machine is probably set
to NOTICE and one to WARNING.

Some useful commands:
   SHOW client_min_messages;
   ALTER DATABASE db1 SET client_min_messages = 'WARNING';
   ALTER USER u1 SET client_min_messages = ...

--
   Richard Huxton
   Archonet Ltd