Re: PGAdmin Auto-commits?

From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Michael Shapiro" <mshapiro51(at)gmail(dot)com>
Cc: Pgadmin-Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: PGAdmin Auto-commits?
Date: 2008-10-02 13:33:59
Message-ID: 937d27e10810020633k164e7f4bsb5213d86d2bfbed0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Thu, Oct 2, 2008 at 2:12 PM, Michael Shapiro <mshapiro51(at)gmail(dot)com> wrote:
> Does the SQL window explicitly start a transaction so that all the stmts in
> it are committed (or rolled back) if one of the fails?
> Or does each stmt execute in its own transaction? Or does it just submit the
> entire text as a single query and let Postgres decide how to wrap it in a
> transaction?

The latter.

> This is really a question of how PgAmin executes the queries in a given
> window.
>
> As for how Postgres handles multiple stmts, this list (or you) may not be
> the place for that question, but I don't think BEGIN/END does anyting
> explicitly wrt to transactions, other than perhaps treat the stmts between
> BEGIN/END as a single stmt, but I'm really not sure of this.

If a connection has an explicitly opened transaction on it, no further
statements (multi statement queries or single) will be committed
unless a commit is executed. If no transaction is started by the user,
each query (multi or single statement) will commit immediated.

So:

UPDATE foo SET a = b;
<F5>

will commit immediately.

BEGIN;
UPDATE foo SET a = b;
<F5>

will not commit until you do:

COMMIT;
<F5>

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message susan.williams 2008-10-02 15:21:31 pgadmin 1.8.4 pgagent schedule issue
Previous Message Dave Page 2008-10-02 13:04:34 Re: PGAdmin Auto-commits?