EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
531 stars 162 forks source link

Support column_name option in create foreign table #86

Open dumbuzz opened 8 years ago

dumbuzz commented 8 years ago

Trying to set column_name in create foreign table via:

CREATE FOREIGN TABLE exchange.test
   ("id" integer OPTIONS (column_name 'key'),
    "name" character varying(300) )
   SERVER mysql_srv
   OPTIONS (dbname 'test', table_name 'test');

and get error:

ERROR:  invalid option "column_name"
HINT:  Valid options in this context are: <none>

Is there any way to create foreign table in postgresql with column_name which differs from mysql column_name?

asaarnak commented 8 years ago

You could write a view for the foreign table where you can specify column names, until this OPTION is not supported.