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

From Stephen Frost
Subject Re: IMPORT FOREIGN SCHEMA statement
Date
Msg-id 20140527140031.GJ2556@tamriel.snowman.net
Whole thread Raw
In response to Re: IMPORT FOREIGN SCHEMA statement  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
List pgsql-hackers
* Ronan Dunklau (ronan.dunklau@dalibo.com) wrote:
> So, without extending the syntax too much, we could add options:
>
> IMPORT FOREIGN SCHEMA remote_schema FROM SERVER server_name INTO local_schema
> [ { LIMIT TO | EXCEPT } (table_name [, ...])]
> [ OPTIONS (option_list) ]
>
> This option list could then contain fdw-specific options, including type
> mapping.

Yup, that looks reasonable to me.

> Or we could add a specific clause:
>
> IMPORT FOREIGN SCHEMA remote_schema FROM SERVER server_name INTO local_schema
> [ { LIMIT TO | EXCEPT } (table_name [, ...])]
> [ OPTIONS (option_list) ]
> [ TYPE MAPPING some mapping_definition ]

-1 on this one.

> With mapping_definition being either a tuple, or well-defined jsonb format
> common accross FDWs.
>
> A third solution, which I don't like but doesn't modify the SQL grammar, would
> be to encode the options in the remote_schema name.

Yeah, don't like that one either.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: IMPORT FOREIGN SCHEMA statement
Next
From: Petr Jelinek
Date:
Subject: Re: IMPORT FOREIGN SCHEMA statement