Search Postgresql Archives

dblink and commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

I an wondering how things happen, related to transactions using dblink.

I am doing the following thing (simplified, of course), on ServerA:

------------------------------------------------
BEGIN

insert into TableA_ServerA (...)
   select * from dblink(ServerB, select * from tableA_ServerB)

insert into TableB_ServerA (...)
   select * from dblink(ServerB, select * from tableB_ServerB)

dblink(serverB, delete from tableA_ServerB)
dblink(serverB, delete from tableB_ServerB)

COMMIT
------------------------------------------------

What happens if connection is lost when executing the last dblink? Are the data from tableA_serverB deleted (what I would like to avoid)?

If they are deleted, is there a way to handle this - do the 2 local insert and the 2 remote delete (normal case), but do nothing at all if something went bad at one time?

Thanks for your attention,
Daniel

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux