Re: Transactions through dblink_exec()

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transactions through dblink_exec()
Date: 2002-10-13 06:15:36
Message-ID: 3DA90F88.1030807@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Masaru Sugawara wrote:
> Hi, all
>
> While trying dblink_exec(), one of dblink()'s functions, I noticed there was an
> odd situation: case 1 and case 2 worked well, but case 3 didn't(see below).
> I hadn't been aware of it so that I only executed BEGIN and END in
> dblink_exec() at first . This time, however, I noticed it by executing ROLLBACK.
>
> I'm hoping that dblink_exec() returns something like warning if those who intend
> to do transactions make a declaration of blink_exec('dbname=some', 'begin') by mistake.
>
> for example
> WARNING :You should declare dblink_exec('dbname=some', 'BEGIN; some queries;
> COMMIT/ROLLBACK/END;') or use dblink_exec('BEGIN/COMMIT/ROLLBACK/END')
> around dblink_exec('some queries')s. If not, your transactions won't work.

How can dblink() possibly be used safely for non-readonly
transactions without a full implementation of a two-phase commit
protocol? What happens when the remote server issues the COMMIT
and then the local server crashes?

Mike Mascari
mascarm(at)mascari(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-10-13 06:37:18 Re: Transactions through dblink_exec()
Previous Message Gavin Sherry 2002-10-13 05:52:30 Re: pgsql 7.2.3 crash