64 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
139 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
194 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
238 "FDWConnectionContext",
255 errmsg(
"foreign data wrapper \"%s\" does not support subscription connections",
257 errdetail(
"Foreign data wrapper must be defined with CONNECTION specified.")));
314 errmsg(
"user mapping not found for user \"%s\", server \"%s\"",
321 um->serverid = serverid;
353 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
392 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
425 errmsg(
"access to non-system foreign table is restricted")));
432 elog(
ERROR,
"foreign-data wrapper handler function %u did not return an FdwRoutine struct",
452 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
477 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
485 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
487 fdwhandler =
fdwform->fdwhandler;
493 errmsg(
"foreign-data wrapper \"%s\" has no handler",
576 switch (
stmt->list_type)
582 foreach(
lc,
stmt->table_list)
592 foreach(
lc,
stmt->table_list)
751 errhint(
"Perhaps you meant the option \"%s\".",
753 errhint(
"There are no valid options in this context.")));
780 errmsg(
"foreign-data wrapper \"%s\" does not exist",
802 errmsg(
"server \"%s\" does not exist", servername)));
842 if (path->param_info !=
NULL)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define Assert(condition)
#define OidIsValid(objectId)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
#define palloc_object(type)
#define DatumGetTextPP(X)
#define OidFunctionCall0(functionId)
#define PG_GETARG_DATUM(n)
#define OidFunctionCall3(functionId, arg1, arg2, arg3)
#define PG_RETURN_BOOL(x)
static bool is_conninfo_option(const char *option, Oid context)
static const struct ConnectionOption libpq_conninfo_options[]
ForeignDataWrapper * GetForeignDataWrapper(Oid fdwid)
ForeignServer * GetForeignServerByName(const char *srvname, bool missing_ok)
FdwRoutine * GetFdwRoutineForRelation(Relation relation, bool makecopy)
FdwRoutine * GetFdwRoutineByServerId(Oid serverid)
ForeignTable * GetForeignTable(Oid relid)
Path * GetExistingLocalJoinPath(RelOptInfo *joinrel)
UserMapping * GetUserMapping(Oid userid, Oid serverid)
Oid get_foreign_server_oid(const char *servername, bool missing_ok)
char * ForeignServerName(Oid serverid)
ForeignServer * GetForeignServer(Oid serverid)
Datum pg_options_to_table(PG_FUNCTION_ARGS)
ForeignDataWrapper * GetForeignDataWrapperExtended(Oid fdwid, bits16 flags)
Datum postgresql_fdw_validator(PG_FUNCTION_ARGS)
FdwRoutine * GetFdwRoutineByRelId(Oid relid)
ForeignDataWrapper * GetForeignDataWrapperByName(const char *fdwname, bool missing_ok)
char * ForeignServerConnectionString(Oid userid, Oid serverid)
Oid GetForeignServerIdByRelId(Oid relid)
bool IsImportableForeignTable(const char *tablename, ImportForeignSchemaStmt *stmt)
ForeignServer * GetForeignServerExtended(Oid serverid, bits16 flags)
FdwRoutine * GetFdwRoutine(Oid fdwhandler)
List * GetForeignColumnOptions(Oid relid, AttrNumber attnum)
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)
static void * GETSTRUCT(const HeapTupleData *tuple)
struct parser_state match_state[5]
void * MemoryContextAlloc(MemoryContext context, Size size)
char * pstrdup(const char *in)
MemoryContext CurrentMemoryContext
MemoryContext CacheMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_SMALL_SIZES
#define IsA(nodeptr, _type_)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
@ FDW_IMPORT_SCHEMA_LIMIT_TO
@ FDW_IMPORT_SCHEMA_EXCEPT
bool pathkeys_count_contained_in(List *keys1, List *keys2, int *n_common)
bool pathkeys_contained_in(List *keys1, List *keys2)
END_CATALOG_STRUCT typedef FormData_pg_foreign_data_wrapper * Form_pg_foreign_data_wrapper
END_CATALOG_STRUCT typedef FormData_pg_foreign_server * Form_pg_foreign_server
END_CATALOG_STRUCT typedef FormData_pg_foreign_table * Form_pg_foreign_table
END_CATALOG_STRUCT typedef FormData_pg_user_mapping * Form_pg_user_mapping
int restrict_nonsystem_relation_kind
static Datum PointerGetDatum(const void *X)
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
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache2(SysCacheIdentifier cacheId, Datum key1, Datum key2)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
#define GetSysCacheOid1(cacheId, oidcol, key1)
#define RESTRICT_RELKIND_FOREIGN_TABLE
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)
const char * getClosestMatch(ClosestMatchState *state)
void initClosestMatch(ClosestMatchState *state, const char *source, int max_d)
void updateClosestMatch(ClosestMatchState *state, const char *candidate)
char * text_to_cstring(const text *t)