62 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
70 fdw->
owner = fdwform->fdwowner;
78 Anum_pg_foreign_data_wrapper_fdwoptions,
136 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
145 server->
owner = serverform->srvowner;
146 server->
fdwid = serverform->srvfdw;
151 Anum_pg_foreign_server_srvtype,
158 Anum_pg_foreign_server_srvversion,
165 Anum_pg_foreign_server_srvoptions,
221 (
errcode(ERRCODE_UNDEFINED_OBJECT),
222 errmsg(
"user mapping not found for \"%s\"",
233 Anum_pg_user_mapping_umoptions,
260 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
270 Anum_pg_foreign_table_ftoptions,
299 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
303 Anum_pg_attribute_attfdwoptions,
330 elog(
ERROR,
"foreign-data wrapper handler function %u did not return an FdwRoutine struct",
350 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
352 serverid = tableform->ftserver;
375 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
377 fdwid = serverform->srvfdw;
383 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
385 fdwhandler = fdwform->fdwhandler;
390 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
391 errmsg(
"foreign-data wrapper \"%s\" has no handler",
442 memcpy(cfdwroutine, fdwroutine,
sizeof(
FdwRoutine));
474 switch (
stmt->list_type)
480 foreach(lc,
stmt->table_list)
484 if (strcmp(tablename, rv->
relname) == 0)
490 foreach(lc,
stmt->table_list)
494 if (strcmp(tablename, rv->
relname) == 0)
563 {
"authtype", ForeignServerRelationId},
564 {
"service", ForeignServerRelationId},
565 {
"user", UserMappingRelationId},
566 {
"password", UserMappingRelationId},
567 {
"connect_timeout", ForeignServerRelationId},
568 {
"dbname", ForeignServerRelationId},
569 {
"host", ForeignServerRelationId},
570 {
"hostaddr", ForeignServerRelationId},
571 {
"port", ForeignServerRelationId},
572 {
"tty", ForeignServerRelationId},
573 {
"options", ForeignServerRelationId},
574 {
"requiressl", ForeignServerRelationId},
575 {
"sslmode", ForeignServerRelationId},
576 {
"gsslib", ForeignServerRelationId},
577 {
"gssdelegation", ForeignServerRelationId},
619 foreach(cell, options_list)
626 const char *closest_match;
628 bool has_valid_options =
false;
639 has_valid_options =
true;
646 (
errcode(ERRCODE_SYNTAX_ERROR),
648 has_valid_options ? closest_match ?
649 errhint(
"Perhaps you meant the option \"%s\".",
651 errhint(
"There are no valid options in this context.")));
673 Anum_pg_foreign_data_wrapper_oid,
677 (
errcode(ERRCODE_UNDEFINED_OBJECT),
678 errmsg(
"foreign-data wrapper \"%s\" does not exist",
699 (
errcode(ERRCODE_UNDEFINED_OBJECT),
700 errmsg(
"server \"%s\" does not exist", servername)));
740 if (path->param_info != NULL)
749 memcpy(hash_path, path,
sizeof(
HashPath));
758 memcpy(nest_path, path,
sizeof(
NestPath));
767 memcpy(merge_path, path,
sizeof(
MergePath));
810 return (
Path *) joinpath;
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
elog(ERROR, "%s: %s", p2, msg)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define OidFunctionCall0(functionId)
#define PG_GETARG_DATUM(n)
#define PG_RETURN_BOOL(x)
ForeignDataWrapper * GetForeignDataWrapper(Oid fdwid)
ForeignServer * GetForeignServerExtended(Oid serverid, bits16 flags)
static bool is_conninfo_option(const char *option, Oid context)
static const struct ConnectionOption libpq_conninfo_options[]
FdwRoutine * GetFdwRoutineByRelId(Oid relid)
ForeignTable * GetForeignTable(Oid relid)
Path * GetExistingLocalJoinPath(RelOptInfo *joinrel)
Oid get_foreign_server_oid(const char *servername, bool missing_ok)
UserMapping * GetUserMapping(Oid userid, Oid serverid)
List * GetForeignColumnOptions(Oid relid, AttrNumber attnum)
Datum pg_options_to_table(PG_FUNCTION_ARGS)
Datum postgresql_fdw_validator(PG_FUNCTION_ARGS)
FdwRoutine * GetFdwRoutineForRelation(Relation relation, bool makecopy)
FdwRoutine * GetFdwRoutine(Oid fdwhandler)
ForeignDataWrapper * GetForeignDataWrapperExtended(Oid fdwid, bits16 flags)
ForeignDataWrapper * GetForeignDataWrapperByName(const char *fdwname, bool missing_ok)
ForeignServer * GetForeignServer(Oid serverid)
ForeignServer * GetForeignServerByName(const char *srvname, bool missing_ok)
Oid GetForeignServerIdByRelId(Oid relid)
FdwRoutine * GetFdwRoutineByServerId(Oid serverid)
bool IsImportableForeignTable(const char *tablename, ImportForeignSchemaStmt *stmt)
Oid get_foreign_data_wrapper_oid(const char *fdwname, bool missing_ok)
#define MappingUserName(userid)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
#define MAT_SRF_USE_EXPECTED_DESC
#define HeapTupleIsValid(tuple)
struct parser_state match_state[5]
if(TABLE==NULL||TABLE_index==NULL)
Assert(fmt[strlen(fmt) - 1] !='\n')
char * pstrdup(const char *in)
void * MemoryContextAlloc(MemoryContext context, Size size)
MemoryContext CacheMemoryContext
#define IsA(nodeptr, _type_)
@ FDW_IMPORT_SCHEMA_LIMIT_TO
@ FDW_IMPORT_SCHEMA_EXCEPT
FormData_pg_foreign_data_wrapper * Form_pg_foreign_data_wrapper
FormData_pg_foreign_server * Form_pg_foreign_server
FormData_pg_foreign_table * Form_pg_foreign_table
FormData_pg_user_mapping * Form_pg_user_mapping
static Datum Int16GetDatum(int16 X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static Datum CStringGetDatum(const char *X)
#define RelationGetRelid(relation)
List * untransformRelOptions(Datum options)
struct FdwRoutine * rd_fdwroutine
Tuplestorestate * setResult
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
#define GetSysCacheOid1(cacheId, oidcol, key1)
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, Datum *values, bool *isnull)
const char * getClosestMatch(ClosestMatchState *state)
void initClosestMatch(ClosestMatchState *state, const char *source, int max_d)
void updateClosestMatch(ClosestMatchState *state, const char *candidate)