61 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
69 fdw->
owner = fdwform->fdwowner;
77 Anum_pg_foreign_data_wrapper_fdwoptions,
135 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
144 server->
owner = serverform->srvowner;
145 server->
fdwid = serverform->srvfdw;
150 Anum_pg_foreign_server_srvtype,
157 Anum_pg_foreign_server_srvversion,
164 Anum_pg_foreign_server_srvoptions,
220 (
errcode(ERRCODE_UNDEFINED_OBJECT),
221 errmsg(
"user mapping not found for \"%s\"",
232 Anum_pg_user_mapping_umoptions,
259 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
269 Anum_pg_foreign_table_ftoptions,
298 elog(
ERROR,
"cache lookup failed for attribute %d of relation %u",
302 Anum_pg_attribute_attfdwoptions,
329 elog(
ERROR,
"foreign-data wrapper handler function %u did not return an FdwRoutine struct",
349 elog(
ERROR,
"cache lookup failed for foreign table %u", relid);
351 serverid = tableform->ftserver;
374 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
376 fdwid = serverform->srvfdw;
382 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
384 fdwhandler = fdwform->fdwhandler;
389 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
390 errmsg(
"foreign-data wrapper \"%s\" has no handler",
441 memcpy(cfdwroutine, fdwroutine,
sizeof(
FdwRoutine));
483 if (strcmp(tablename, rv->
relname) == 0)
493 if (strcmp(tablename, rv->
relname) == 0)
562 {
"authtype", ForeignServerRelationId},
563 {
"service", ForeignServerRelationId},
564 {
"user", UserMappingRelationId},
565 {
"password", UserMappingRelationId},
566 {
"connect_timeout", ForeignServerRelationId},
567 {
"dbname", ForeignServerRelationId},
568 {
"host", ForeignServerRelationId},
569 {
"hostaddr", ForeignServerRelationId},
570 {
"port", ForeignServerRelationId},
571 {
"tty", ForeignServerRelationId},
572 {
"options", ForeignServerRelationId},
573 {
"requiressl", ForeignServerRelationId},
574 {
"sslmode", ForeignServerRelationId},
575 {
"gsslib", ForeignServerRelationId},
617 foreach(cell, options_list)
637 (
errcode(ERRCODE_SYNTAX_ERROR),
640 ?
errhint(
"Valid options in this context are: %s",
642 :
errhint(
"There are no valid options in this context.")));
664 Anum_pg_foreign_data_wrapper_oid,
668 (
errcode(ERRCODE_UNDEFINED_OBJECT),
669 errmsg(
"foreign-data wrapper \"%s\" does not exist",
690 (
errcode(ERRCODE_UNDEFINED_OBJECT),
691 errmsg(
"server \"%s\" does not exist", servername)));
740 memcpy(hash_path, path,
sizeof(
HashPath));
749 memcpy(nest_path, path,
sizeof(
NestPath));
758 memcpy(merge_path, path,
sizeof(
MergePath));
801 return (
Path *) joinpath;
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
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 SetSingleFuncCall(FunctionCallInfo fcinfo, bits32 flags)
#define SRF_SINGLE_USE_EXPECTED
#define HeapTupleIsValid(tuple)
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
#define CStringGetDatum(X)
#define DatumGetPointer(X)
#define ObjectIdGetDatum(X)
#define RelationGetRelid(relation)
List * untransformRelOptions(Datum options)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
ImportForeignSchemaType list_type
ParamPathInfo * param_info
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)