Re: Writable foreign tables: how to identify rows

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Writable foreign tables: how to identify rows
Дата
Msg-id 17693.1362589578@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Writable foreign tables: how to identify rows  (Shigeru Hanada <shigeru.hanada@gmail.com>)
Ответы Re: Writable foreign tables: how to identify rows  (Robert Haas <robertmhaas@gmail.com>)
Re: Writable foreign tables: how to identify rows  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Shigeru Hanada <shigeru.hanada@gmail.com> writes:
> I'm not sure whether postgres_fdw should support, but updatable views
> have no system column including ctid.  So, we need magic identifier,
> perhaps it would be set of primary key value(s), to support updating
> remote updatable views via foreign tables.

Yeah, I considered that.  I thought seriously about proposing that we
forget magic row identifiers altogether, and instead make postgres_fdw
require a remote primary key for a foreign table to be updatable.  That
would solve the immediate problem since we'd no longer need any system
columns at all.  On balance though I think it's better for postgres_fdw
to use ctid for this purpose, at least for now: ctid is
better-performing and more reliable than a PK (since someone might
mis-describe the PK, or change a row's PK value underneath us).
Perhaps in a future release we could add a table option to use PK row
identification, but I don't want to try to implement both methods in
postgres_fdw right now.

On the other hand, I don't have a problem with decreeing that
non-Postgres FDWs need to use PK row identification in the first
release; which would be the consequence if we don't do anything about
allowing new system columns in 9.3.  We will certainly need that style
of row identification to be written and tested anyway.  It won't stop
us from extending things later.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Enabling Checksums
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Optimizing pglz compressor