Re: Writable foreign tables: how to identify rows - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Writable foreign tables: how to identify rows
Date
Msg-id 26208.1363186795@sss.pgh.pa.us
Whole thread Raw
In response to Re: Writable foreign tables: how to identify rows  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> I just find it odd that rowid concept is used at all without strong
> guarantee that the record you are referencing is the one you are
> supposed to be referencing.  Basically I'm saying PKEY semantics are
> the correct ones and that ctid is ok to use iff they match the pkey
> ones.  I don't think this is possible unless you maintain a remote
> lock on the ctid between when you fetch it and do some other
> operation.

postgres_fdw does maintain such a lock (it does SELECT FOR UPDATE when
scanning an update/delete target table).  However, I'm not exactly sure
why you think a pkey-based design would be free of such hazards.  pkeys
aren't immutable either ...
        regards, tom lane



pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Writable foreign tables: how to identify rows
Next
From: Andres Freund
Date:
Subject: Re: Writable foreign tables: how to identify rows