]> granicus.if.org Git - postgresql/commit
Rearrange dblink's dblink_build_sql_insert() and related routines to open and
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Jun 2010 20:49:33 +0000 (20:49 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Jun 2010 20:49:33 +0000 (20:49 +0000)
commit6bbaa3148d65b3bed987c40b78e2b9a55bdfab58
tree4ffc36ae420c76b886e3bbc9d151d79ff5a007a7
parentcbb0dcff4f37714b7ba80f2d2b05d647f7b53b47
Rearrange dblink's dblink_build_sql_insert() and related routines to open and
lock the target relation just once per SQL function call.  The original coding
obtained and released lock several times per call.  Aside from saving a
not-insignificant number of cycles, this eliminates possible race conditions
if someone tries to modify the relation's schema concurrently.  Also
centralize locking and permission-checking logic.

Problem noted while investigating a trouble report from Robert Voinea --- his
problem is still to be fixed, though.
contrib/dblink/dblink.c