|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/reloptions.h"#include "access/table.h"#include "access/xact.h"#include "catalog/catalog.h"#include "catalog/dependency.h"#include "catalog/indexing.h"#include "catalog/objectaccess.h"#include "catalog/pg_foreign_data_wrapper.h"#include "catalog/pg_foreign_server.h"#include "catalog/pg_foreign_table.h"#include "catalog/pg_proc.h"#include "catalog/pg_type.h"#include "catalog/pg_user_mapping.h"#include "commands/defrem.h"#include "foreign/fdwapi.h"#include "foreign/foreign.h"#include "miscadmin.h"#include "parser/parse_func.h"#include "tcop/utility.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/lsyscache.h"#include "utils/rel.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | import_error_callback_arg |
| ObjectAddress AlterForeignDataWrapper | ( | ParseState * | pstate, |
| AlterFdwStmt * | stmt | ||
| ) |
Definition at line 685 of file foreigncmds.c.
References CatalogTupleUpdate(), CStringGetDatum(), DatumGetPointer(), deleteDependencyRecordsForClass(), DEPENDENCY_NORMAL, ereport, errcode(), errhint(), errmsg(), ERROR, fb(), GETSTRUCT(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, parse_func_options(), PointerGetDatum(), recordDependencyOn(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, stmt, superuser(), SysCacheGetAttr(), HeapTupleData::t_self, table_close(), table_open(), transformGenericOptions(), and WARNING.
Referenced by ProcessUtilitySlow().
| ObjectAddress AlterForeignDataWrapperOwner | ( | const char * | name, |
| Oid | newOwnerId | ||
| ) |
Definition at line 286 of file foreigncmds.c.
References AlterForeignDataWrapperOwner_internal(), CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, fb(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, name, ObjectAddressSet, RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by ExecAlterOwnerStmt().
|
static |
Definition at line 216 of file foreigncmds.c.
References aclnewowner(), CatalogTupleUpdate(), changeDependencyOnOwner(), DatumGetAclP, ereport, errcode(), errhint(), errmsg(), ERROR, fb(), GETSTRUCT(), heap_getattr(), heap_modify_tuple(), InvokeObjectPostAlterHook, NameStr, ObjectIdGetDatum(), PointerGetDatum(), RelationGetDescr, superuser(), and superuser_arg().
Referenced by AlterForeignDataWrapperOwner(), and AlterForeignDataWrapperOwner_oid().
Definition at line 324 of file foreigncmds.c.
References AlterForeignDataWrapperOwner_internal(), ereport, errcode(), errmsg(), ERROR, fb(), heap_freetuple(), HeapTupleIsValid, ObjectIdGetDatum(), RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by shdepReassignOwned_Owner().
| ObjectAddress AlterForeignServer | ( | AlterForeignServerStmt * | stmt | ) |
Definition at line 985 of file foreigncmds.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, CatalogTupleUpdate(), CStringGetDatum(), CStringGetTextDatum, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, fb(), GetForeignDataWrapper(), GETSTRUCT(), GetUserId(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, OBJECT_FOREIGN_SERVER, object_ownercheck(), ObjectAddressSet, PointerGetDatum(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, stmt, SysCacheGetAttr(), HeapTupleData::t_self, table_close(), table_open(), and transformGenericOptions().
Referenced by ProcessUtilitySlow().
| ObjectAddress AlterForeignServerOwner | ( | const char * | name, |
| Oid | newOwnerId | ||
| ) |
Definition at line 426 of file foreigncmds.c.
References AlterForeignServerOwner_internal(), CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, fb(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, name, ObjectAddressSet, RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by ExecAlterOwnerStmt().
Definition at line 349 of file foreigncmds.c.
References ACL_USAGE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, aclnewowner(), CatalogTupleUpdate(), changeDependencyOnOwner(), check_can_set_role(), DatumGetAclP, fb(), GetForeignDataWrapper(), GETSTRUCT(), GetUserId(), heap_getattr(), heap_modify_tuple(), InvokeObjectPostAlterHook, NameStr, object_aclcheck(), OBJECT_FDW, OBJECT_FOREIGN_SERVER, object_ownercheck(), ObjectIdGetDatum(), PointerGetDatum(), RelationGetDescr, and superuser().
Referenced by AlterForeignServerOwner(), and AlterForeignServerOwner_oid().
Definition at line 461 of file foreigncmds.c.
References AlterForeignServerOwner_internal(), ereport, errcode(), errmsg(), ERROR, fb(), heap_freetuple(), HeapTupleIsValid, ObjectIdGetDatum(), RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by shdepReassignOwned_Owner().
| ObjectAddress AlterUserMapping | ( | AlterUserMappingStmt * | stmt | ) |
Definition at line 1237 of file foreigncmds.c.
References ACL_ID_PUBLIC, CatalogTupleUpdate(), DatumGetPointer(), elog, ereport, errcode(), errmsg(), ERROR, fb(), get_rolespec_oid(), GetForeignDataWrapper(), GetForeignServerByName(), GetSysCacheOid2, heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, MappingUserName, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, PointerGetDatum(), RelationGetDescr, ROLESPEC_PUBLIC, RoleSpec::roletype, RowExclusiveLock, SearchSysCacheCopy1, stmt, SysCacheGetAttr(), HeapTupleData::t_self, table_close(), table_open(), transformGenericOptions(), and user_mapping_ddl_aclcheck().
Referenced by ProcessUtilitySlow().
| ObjectAddress CreateForeignDataWrapper | ( | ParseState * | pstate, |
| CreateFdwStmt * | stmt | ||
| ) |
Definition at line 569 of file foreigncmds.c.
References CatalogTupleInsert(), CStringGetDatum(), DatumGetPointer(), DEPENDENCY_NORMAL, DirectFunctionCall1, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errhint(), errmsg(), ERROR, fb(), GetForeignDataWrapperByName(), GetNewOidWithIndex(), GetUserId(), heap_form_tuple(), heap_freetuple(), InvokeObjectPostCreateHook, namein(), ObjectIdGetDatum(), OidIsValid, parse_func_options(), PointerGetDatum(), RelationData::rd_att, recordDependencyOn(), recordDependencyOnCurrentExtension(), recordDependencyOnOwner(), RowExclusiveLock, stmt, superuser(), table_close(), table_open(), transformGenericOptions(), and values.
Referenced by ProcessUtilitySlow().
| ObjectAddress CreateForeignServer | ( | CreateForeignServerStmt * | stmt | ) |
Definition at line 849 of file foreigncmds.c.
References ACL_USAGE, aclcheck_error(), ACLCHECK_OK, CatalogTupleInsert(), checkMembershipInCurrentExtension(), CStringGetDatum(), CStringGetTextDatum, DatumGetPointer(), DEPENDENCY_NORMAL, DirectFunctionCall1, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, fb(), get_foreign_server_oid(), GetForeignDataWrapperByName(), GetNewOidWithIndex(), GetUserId(), heap_form_tuple(), heap_freetuple(), InvalidObjectAddress, InvokeObjectPostCreateHook, namein(), NOTICE, object_aclcheck(), OBJECT_FDW, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, PointerGetDatum(), RelationData::rd_att, recordDependencyOn(), recordDependencyOnCurrentExtension(), recordDependencyOnOwner(), RowExclusiveLock, stmt, table_close(), table_open(), transformGenericOptions(), and values.
Referenced by ProcessUtilitySlow().
| void CreateForeignTable | ( | CreateForeignTableStmt * | stmt, |
| Oid | relid | ||
| ) |
Definition at line 1415 of file foreigncmds.c.
References ACL_USAGE, aclcheck_error(), ACLCHECK_OK, CatalogTupleInsert(), CommandCounterIncrement(), DatumGetPointer(), DEPENDENCY_NORMAL, fb(), ForeignServer::fdwid, GetForeignDataWrapper(), GetForeignServerByName(), GetUserId(), heap_form_tuple(), heap_freetuple(), object_aclcheck(), OBJECT_FOREIGN_SERVER, ObjectIdGetDatum(), PointerGetDatum(), recordDependencyOn(), RowExclusiveLock, ForeignServer::serverid, ForeignServer::servername, stmt, table_close(), table_open(), transformGenericOptions(), and values.
Referenced by ProcessUtilitySlow().
| ObjectAddress CreateUserMapping | ( | CreateUserMappingStmt * | stmt | ) |
Definition at line 1111 of file foreigncmds.c.
References ACL_ID_PUBLIC, CatalogTupleInsert(), DatumGetPointer(), DEPENDENCY_NORMAL, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, fb(), get_rolespec_oid(), GetForeignDataWrapper(), GetForeignServerByName(), GetNewOidWithIndex(), GetSysCacheOid2, heap_form_tuple(), heap_freetuple(), InvalidObjectAddress, InvokeObjectPostCreateHook, MappingUserName, NOTICE, ObjectIdGetDatum(), OidIsValid, PointerGetDatum(), RelationData::rd_att, recordDependencyOn(), recordDependencyOnOwner(), ROLESPEC_PUBLIC, RoleSpec::roletype, RowExclusiveLock, stmt, table_close(), table_open(), transformGenericOptions(), user_mapping_ddl_aclcheck(), and values.
Referenced by ProcessUtilitySlow().
Definition at line 1612 of file foreigncmds.c.
References arg, import_error_callback_arg::cmd, errcontext, errposition(), fb(), geterrposition(), internalerrposition(), internalerrquery(), and import_error_callback_arg::tablename.
Referenced by ImportForeignSchema().
| void ImportForeignSchema | ( | ImportForeignSchemaStmt * | stmt | ) |
Definition at line 1495 of file foreigncmds.c.
References ACL_USAGE, aclcheck_error(), ACLCHECK_OK, PlannedStmt::canSetTag, import_error_callback_arg::cmd, CMD_UTILITY, CommandCounterIncrement(), PlannedStmt::commandType, elog, ereport, errcode(), errmsg(), ERROR, error_context_stack, fb(), ForeignServer::fdwid, GetFdwRoutine(), GetForeignDataWrapper(), GetForeignServerByName(), GetUserId(), import_error_callback(), IsA, IsImportableForeignTable(), lfirst, lfirst_node, LookupCreationNamespace(), makeNode, nodeTag, None_Receiver, object_aclcheck(), OBJECT_FOREIGN_SERVER, OidIsValid, pg_parse_query(), PLAN_STMT_INTERNAL, PlannedStmt::planOrigin, ErrorContextCallback::previous, PROCESS_UTILITY_SUBCOMMAND, ProcessUtility(), pstrdup(), ForeignServer::serverid, ForeignServer::servername, RawStmt::stmt, stmt, RawStmt::stmt_len, PlannedStmt::stmt_len, RawStmt::stmt_location, PlannedStmt::stmt_location, import_error_callback_arg::tablename, and PlannedStmt::utilityStmt.
Referenced by ProcessUtilitySlow().
Definition at line 486 of file foreigncmds.c.
References DefElem::arg, ereport, errcode(), errmsg(), ERROR, fb(), get_func_rettype(), InvalidOid, LookupFuncName(), and NameListToString().
Referenced by parse_func_options().
Definition at line 510 of file foreigncmds.c.
References fb(), InvalidOid, and LookupFuncName().
Referenced by parse_func_options().
Definition at line 66 of file foreigncmds.c.
References accumArrayResult(), CurrentMemoryContext, defGetString(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, fb(), len, lfirst, makeArrayResult(), name, palloc(), PointerGetDatum(), SET_VARSIZE(), sprintf, value, VARDATA(), and VARHDRSZ.
Referenced by transformGenericOptions().
|
static |
Definition at line 529 of file foreigncmds.c.
References DefElem::defname, elog, ERROR, errorConflictingDefElem(), fb(), InvalidOid, lfirst, lookup_fdw_handler_func(), and lookup_fdw_validator_func().
Referenced by AlterForeignDataWrapper(), and CreateForeignDataWrapper().
| Oid RemoveUserMapping | ( | DropUserMappingStmt * | stmt | ) |
Definition at line 1335 of file foreigncmds.c.
References ACL_ID_PUBLIC, DROP_CASCADE, elog, ereport, errcode(), errmsg(), ERROR, fb(), get_rolespec_oid(), GetForeignServerByName(), GetSysCacheOid2, InvalidOid, MappingUserName, NOTICE, ObjectIdGetDatum(), OidIsValid, performDeletion(), RoleSpec::rolename, ROLESPEC_PUBLIC, RoleSpec::roletype, stmt, and user_mapping_ddl_aclcheck().
Referenced by ProcessUtilitySlow().
Definition at line 121 of file foreigncmds.c.
References construct_empty_array(), DatumGetPointer(), DEFELEM_ADD, DEFELEM_DROP, DEFELEM_SET, DEFELEM_UNSPEC, DefElem::defname, elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, fb(), lappend(), lfirst, list_delete_cell(), ObjectIdGetDatum(), OidFunctionCall2, OidIsValid, optionListToArray(), PointerGetDatum(), and untransformRelOptions().
Referenced by AlterForeignDataWrapper(), AlterForeignServer(), AlterUserMapping(), ATExecAlterColumnGenericOptions(), ATExecGenericOptions(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), and CreateUserMapping().
|
static |
Definition at line 1086 of file foreigncmds.c.
References ACL_USAGE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, fb(), GetUserId(), object_aclcheck(), OBJECT_FOREIGN_SERVER, and object_ownercheck().
Referenced by AlterUserMapping(), CreateUserMapping(), and RemoveUserMapping().