mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-23 23:07:15 +08:00
Implement IMPORT FOREIGN SCHEMA.
This command provides an automated way to create foreign table definitions that match remote tables, thereby reducing tedium and chances for error. In this patch, we provide the necessary core-server infrastructure and implement the feature fully in the postgres_fdw foreign-data wrapper. Other wrappers will throw a "feature not supported" error until/unless they are updated. Ronan Dunklau and Michael Paquier, additional work by me
This commit is contained in:
@ -514,6 +514,13 @@ DROP TRIGGER trigtest_after_row ON foreign_schema.foreign_table_1;
|
||||
|
||||
DROP FUNCTION dummy_trigger();
|
||||
|
||||
-- IMPORT FOREIGN SCHEMA
|
||||
IMPORT FOREIGN SCHEMA s1 FROM SERVER s9 INTO public; -- ERROR
|
||||
IMPORT FOREIGN SCHEMA s1 LIMIT TO (t1) FROM SERVER s9 INTO public; --ERROR
|
||||
IMPORT FOREIGN SCHEMA s1 EXCEPT (t1) FROM SERVER s9 INTO public; -- ERROR
|
||||
IMPORT FOREIGN SCHEMA s1 EXCEPT (t1, t2) FROM SERVER s9 INTO public
|
||||
OPTIONS (option1 'value1', option2 'value2'); -- ERROR
|
||||
|
||||
-- DROP FOREIGN TABLE
|
||||
DROP FOREIGN TABLE no_table; -- ERROR
|
||||
DROP FOREIGN TABLE IF EXISTS no_table;
|
||||
|
||||
Reference in New Issue
Block a user