Re: Writable foreign tables: how to identify rows

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Writable foreign tables: how to identify rows
Date: 2013-03-06 09:12:52
Message-ID: 20130306091252.GJ13803@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-03-05 19:30:53 -0500, Tom Lane wrote:
> One of the core problems for a writable-foreign-tables feature is how
> to identify a previously-fetched row for UPDATE or DELETE actions.
> In an ordinary Postgres table, we use the ctid system column for that,
> but a remote table doesn't necessarily have such a thing.
> ...
> For postgres_fdw, that would really be enough, since it could just
> cause a "ctid" column to be created with the usual definition. Then
> it could put the remote ctid into the usual t_self field in returned
> tuples.
>
> Supporting magic identifiers that aren't of the TID data type is
> considerably harder, mainly because it's not clear how heap_getsysattr()
> could know how to fetch the column value. I have some rough ideas
> about that, but I suggest that we might want to punt on that extension
> for the time being.

What about just making it a bytea in fdw's? Now its not nice to waste
space for a (probably 1byte) bytea header, but its not too bad either.
The fdw author then needs to ensure only the correct data ends up in
that system column.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2013-03-06 10:04:25 Re: [GENERAL] Floating point error
Previous Message Alexander Korotkov 2013-03-06 09:06:26 Re: WIP: index support for regexp search