Re: Actions requiring commit

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Lee Horowitz <leeh(at)panix(dot)com>
Cc: Lee <lee(at)jamtoday(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Actions requiring commit
Date: 2010-02-15 17:36:28
Message-ID: 407d949e1002150936n442e29f9t87556c73be2bdcf4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Feb 15, 2010 at 5:14 PM, Lee Horowitz <leeh(at)panix(dot)com> wrote:
> My problem is that I'be been told that I can use dblink() to make a second
> connection to the same database, and then, on that second connection, do
> an
> insert to some table and issue a commit which will make the data in that
> commit visible to other sessions, but NOT commit any pending data on the
> first connection.
>

That's correct. The database server process handling the second
connection won't know anything about the outer transaction. All it
knows is that it received this connection with this insert and then
was asked to commit it. The outer transaction can abort or commit and
it won't affect the status of the insert that the dblink connection
made.

You could see some weird effects if you try to look at that newly
inserted row in the outer transaction, but that's just because it was
inserted after your transaction started.

--
greg

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lee Horowitz 2010-02-15 17:54:24 Re: Actions requiring commit
Previous Message Lee Horowitz 2010-02-15 17:14:24 Re: Actions requiring commit