diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-10 15:01:31 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-07-10 15:01:43 -0400 |
| commit | 59efda3e50ca4de6a9d5aa4491464e22b6329b1e (patch) | |
| tree | 23a2fe16ebc11ad9f95ef3f70c563084d6ca4007 /src/include/foreign | |
| parent | 6a605cd6bd9f689b35676623add0de9b90978bf1 (diff) | |
| download | postgresql-59efda3e50ca4de6a9d5aa4491464e22b6329b1e.tar.gz | |
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
Diffstat (limited to 'src/include/foreign')
| -rw-r--r-- | src/include/foreign/fdwapi.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/foreign/fdwapi.h b/src/include/foreign/fdwapi.h index 1b735dacc6..dc0a7fc723 100644 --- a/src/include/foreign/fdwapi.h +++ b/src/include/foreign/fdwapi.h @@ -100,6 +100,9 @@ typedef bool (*AnalyzeForeignTable_function) (Relation relation, AcquireSampleRowsFunc *func, BlockNumber *totalpages); +typedef List *(*ImportForeignSchema_function) (ImportForeignSchemaStmt *stmt, + Oid serverOid); + /* * FdwRoutine is the struct returned by a foreign-data wrapper's handler * function. It provides pointers to the callback functions needed by the @@ -144,6 +147,9 @@ typedef struct FdwRoutine /* Support functions for ANALYZE */ AnalyzeForeignTable_function AnalyzeForeignTable; + + /* Support functions for IMPORT FOREIGN SCHEMA */ + ImportForeignSchema_function ImportForeignSchema; } FdwRoutine; @@ -151,5 +157,7 @@ typedef struct FdwRoutine extern FdwRoutine *GetFdwRoutine(Oid fdwhandler); extern FdwRoutine *GetFdwRoutineByRelId(Oid relid); extern FdwRoutine *GetFdwRoutineForRelation(Relation relation, bool makecopy); +extern bool IsImportableForeignTable(const char *tablename, + ImportForeignSchemaStmt *stmt); #endif /* FDWAPI_H */ |
