Re: Proposal: IMPORT FOREIGN SCHEMA statement.

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Ronan Dunklau <ronan(dot)dunklau(at)dalibo(dot)com>
Cc: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: IMPORT FOREIGN SCHEMA statement.
Date: 2014-02-21 12:15:01
Message-ID: 61E6C22F-ED00-4952-9330-1292EB2DE477@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Feb21, 2014, at 12:09 , Ronan Dunklau <ronan(dot)dunklau(at)dalibo(dot)com> wrote:
>> I havent had a look at the patch yet since I dont have a nice editor right
>> now, but how do you handle inter operability between datatypes?
>> Specifically, how do you handle those datatypes which have a different name
>> from the PostgreSQL name for them and/or are stored in a different manner?
>
> For the postgres_fdw POC implementation, this is done by parsing the
> attributes type from the query result with the regtype input functions. The
> attribute typmod is injected too.

Who says that the OIDs are the same on the local and the remove postgres
instance? For user-defined types, that's certainly not going to be true...

Also, why do you aggregate the lists of columns, types and oids into arrays
when querying them from the remote server? Just producing a query that returns
one row per table column seems much simpler, both conceptually and implementation
wise.

Finally, I think there are a few missing pieces. For example, you quite easily
could copy over not-NULL flags, but you currently don't. Similarly, what about
inheritance relationships between remote tables? There's a patch in the current
CF, I believe, which adds support for inheritance to foreign tables, so all you'd
have to do is to make the foreign table's inheritance structure match the remote
table's.

best regards,
Florian Pflug

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ronan Dunklau 2014-02-21 12:36:17 Re: Proposal: IMPORT FOREIGN SCHEMA statement.
Previous Message Florian Pflug 2014-02-21 11:54:19 Re: [PATCH] Negative Transition Aggregate Functions (WIP)