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

From Albe Laurenz
Subject Re: IMPORT FOREIGN SCHEMA statement
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17CFE029@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to IMPORT FOREIGN SCHEMA statement  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
Responses Re: IMPORT FOREIGN SCHEMA statement
List pgsql-hackers
Ronan Dunklau wrote:
> Since my last proposal didn't get any strong rebuttal, please find attached a
> more complete version of the IMPORT FOREIGN SCHEMA statement.
> 
> I tried to follow the SQL-MED specification as closely as possible.
> 
> This adds discoverability to foreign servers. The structure of the statement
> as I understand it is simple enough:
> 
> IMPORT FOREIGN SCHEMA remote_schema FROM SERVER some_server [ (LIMIT TO |
> EXCEPT) table_list ] INTO local_schema.
> 
> The import_foreign_schema patch adds the infrastructure, and a new FDW
> routine:
> 
> typedef List *(*ImportForeignSchema_function) (ForeignServer *server,
> ImportForeignSchemaStmt * parsetree);
> 
> This routine must return a list of CreateForeignTableStmt mirroring whatever
> tables were found on the remote side, which will then be executed.

In addition to data type mapping questions (which David already raised)
I have one problem when I think of the Oracle FDW:

Oracle follows the SQL standard in folding table names to upper case.
So this would normally result in a lot of PostgreSQL foreign tables
with upper case names, which would be odd and unpleasant.

I cannot see a way out of that, but I thought I should mention it.

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Matteo Beccati
Date:
Subject: Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD
Next
From: Michael Paquier
Date:
Subject: Re: Re: popen and pclose redefinitions causing many warning in Windows build