Re: Proposal: IMPORT FOREIGN SCHEMA statement. - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Proposal: IMPORT FOREIGN SCHEMA statement.
Date
Msg-id 61E6C22F-ED00-4952-9330-1292EB2DE477@phlo.org
Whole thread Raw
In response to Re: Proposal: IMPORT FOREIGN SCHEMA statement.  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
Responses Re: Proposal: IMPORT FOREIGN SCHEMA statement.  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
List pgsql-hackers
On Feb21, 2014, at 12:09 , Ronan Dunklau <ronan.dunklau@dalibo.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




pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Next
From: Ronan Dunklau
Date:
Subject: Re: Proposal: IMPORT FOREIGN SCHEMA statement.