Re: Transactions through dblink_exec()
От | Mike Mascari |
---|---|
Тема | Re: Transactions through dblink_exec() |
Дата | |
Msg-id | 3DA90F88.1030807@mascari.com обсуждение исходный текст |
Ответ на | Transactions through dblink_exec() (Masaru Sugawara <rk73@sea.plala.or.jp>) |
Список | 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@mascari.com
В списке pgsql-hackers по дате отправления: