Re: postgres_fdw foreign tables and serial columns

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "Nicholson, Brad" <bnicholson(at)hp(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgres_fdw foreign tables and serial columns
Date: 2013-05-15 15:10:59
Message-ID: 20130515151059.GO4361@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> The generic issue there is whether we can allow column defaults to be
> evaluated on the remote end. The original postgres_fdw submission tried
> to support that, but it had enough bugs and logical inconsistencies that
> I ended up ripping that out before commit. There's a good deal of
> discussion about that in the archives (in January or February IIRC).

Yeah, I watched much of that go by- just couldn't follow it entirely at
the time. Still..

> However, when and if we do allow that to work, I'd still say that it's
> reasonable for "SERIAL" to mean local creation of the default value.

I agree with this; all I was trying to get at is that we shouldn't close
off any doors to eventually providing a way for defaults to be pushed to
the remote.

> If you want a remotely-supplied default to work, you'd not put a DEFAULT
> clause into the local definition; and SERIAL is essentially a shorthand
> for a DEFAULT clause.

Agreed.

> Yeah, I think the possibility of such a workaround was one of the
> reasons we decided it was okay to support only locally-computed
> defaults for now.

Right, and, of course, a simple trigger on the remote table would
probably work just fine too.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-05-15 15:35:35 Heap truncation without AccessExclusiveLock (9.4)
Previous Message Tom Lane 2013-05-15 15:03:36 Re: postgres_fdw foreign tables and serial columns