Re: PL/pgSQL equivalent to PQtransactionStatus?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Christophe <xof(at)thebuild(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/pgSQL equivalent to PQtransactionStatus?
Date: 2008-07-31 19:38:08
Message-ID: 20080731193808.GJ8497@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christophe wrote:
>
> On Jul 31, 2008, at 11:49 AM, Alvaro Herrera wrote:
>> Why does it matter?
>
> I'm attempting to "clean out" a connection that is in an unknown state
> (along the lines of what pgpool does when reusing an open connection).
> Of course, I could just fire an ABORT down, but it seems nicer to avoid
> doing so if no transaction block is open.

Maybe DISCARD ALL does what you want?

http://www.postgresql.org/docs/8.3/static/sql-discard.html

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pglists 2008-07-31 19:40:17 Re: How do I set up automatic backups?
Previous Message Mike Gould 2008-07-31 19:28:14 Using PostGres general distribution