tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
381 stars 102 forks source link

Add "prefix" option to Importing a Foreign Schema #204

Open DrLove73 opened 5 years ago

DrLove73 commented 5 years ago

Hi.

Simple option "prefix" (and maybe sufix for versatility?) would allow us to import entire MSSQL schema to PostgreSQL schema without worrying about name conflict. For example if I already have PostgreSQL table "location", I can import MSSQL schema that has table "location" in it in the same schema where my PostgreSQL table is, but with chaged name to for example "ft_location".

It would also help people to easily differentiate foreign tables from regular ones regardless of schema name in front without using ALTER commands.

jcarnu commented 5 years ago

@GeoffMontee as I'm working on that part, do you agree on this feature request ?

cstork commented 4 years ago

Wouldn't it make more sense to import into a new schema and then use a general solution for renaming tables (incl. switching schemas)? This would keep tds_fdw as simple as possible.