On Feb21, 2014, at 12:09 , Ronan Dunklau <ronan.dunk...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers