PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/namespace.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "parser/parse_oper.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.
Functions | |
static Oid | OperatorGet (const char *operatorName, Oid operatorNamespace, Oid leftObjectId, Oid rightObjectId, bool *defined) |
static Oid | OperatorShellMake (const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId) |
static Oid | get_other_operator (List *otherOp, Oid otherLeftTypeId, Oid otherRightTypeId, const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId) |
static bool | validOperatorName (const char *name) |
Oid | OperatorLookup (List *operatorName, Oid leftObjectId, Oid rightObjectId, bool *defined) |
ObjectAddress | OperatorCreate (const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId, Oid procedureId, List *commutatorName, List *negatorName, Oid restrictionId, Oid joinId, bool canMerge, bool canHash) |
void | OperatorValidateParams (Oid leftTypeId, Oid rightTypeId, Oid operResultType, bool hasCommutator, bool hasNegator, bool hasRestrictionSelectivity, bool hasJoinSelectivity, bool canMerge, bool canHash) |
void | OperatorUpd (Oid baseId, Oid commId, Oid negId, bool isDelete) |
ObjectAddress | makeOperatorDependencies (HeapTuple tuple, bool makeExtensionDep, bool isUpdate) |
|
static |
Definition at line 622 of file pg_operator.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_OK, get_namespace_name(), GetUserId(), InvalidOid, object_aclcheck(), OBJECT_SCHEMA, OidIsValid, OperatorLookup(), OperatorShellMake(), and QualifiedNameGetCreationNamespace().
Referenced by OperatorCreate().
ObjectAddress makeOperatorDependencies | ( | HeapTuple | tuple, |
bool | makeExtensionDep, | ||
bool | isUpdate | ||
) |
Definition at line 853 of file pg_operator.c.
References add_exact_object_address(), ObjectAddress::classId, deleteDependencyRecordsFor(), deleteSharedDependencyRecordsFor(), DEPENDENCY_NORMAL, free_object_addresses(), GETSTRUCT, new_object_addresses(), ObjectAddressSet, ObjectAddress::objectId, OidIsValid, oper(), record_object_address_dependencies(), recordDependencyOnCurrentExtension(), and recordDependencyOnOwner().
Referenced by AlterOperator(), OperatorCreate(), and OperatorShellMake().
ObjectAddress OperatorCreate | ( | const char * | operatorName, |
Oid | operatorNamespace, | ||
Oid | leftTypeId, | ||
Oid | rightTypeId, | ||
Oid | procedureId, | ||
List * | commutatorName, | ||
List * | negatorName, | ||
Oid | restrictionId, | ||
Oid | joinId, | ||
bool | canMerge, | ||
bool | canHash | ||
) |
Definition at line 321 of file pg_operator.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, BoolGetDatum(), CatalogTupleInsert(), CatalogTupleUpdate(), CharGetDatum(), elog, ereport, errcode(), errmsg(), ERROR, get_func_rettype(), get_other_operator(), GetNewOidWithIndex(), GetUserId(), heap_form_tuple(), heap_modify_tuple(), HeapTupleIsValid, i, InvalidOid, InvokeObjectPostCreateHook, makeOperatorDependencies(), NameGetDatum(), NameListToString(), namestrcpy(), NIL, OBJECT_OPERATOR, object_ownercheck(), ObjectIdGetDatum(), OidIsValid, OperatorGet(), OperatorUpd(), OperatorValidateParams(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), table_open(), validOperatorName(), and values.
Referenced by DefineOperator().
|
static |
Definition at line 124 of file pg_operator.c.
References GETSTRUCT, HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), PointerGetDatum(), RegProcedureIsValid, ReleaseSysCache(), and SearchSysCache4().
Referenced by OperatorCreate().
Definition at line 164 of file pg_operator.c.
References get_opcode(), InvalidOid, LookupOperName(), OidIsValid, and RegProcedureIsValid.
Referenced by get_other_operator(), and ValidateOperatorReference().
|
static |
Definition at line 193 of file pg_operator.c.
References BoolGetDatum(), CatalogTupleInsert(), CharGetDatum(), CommandCounterIncrement(), ereport, errcode(), errmsg(), ERROR, GetNewOidWithIndex(), GetUserId(), heap_form_tuple(), heap_freetuple(), i, InvalidOid, InvokeObjectPostCreateHook, makeOperatorDependencies(), NameGetDatum(), namestrcpy(), ObjectIdGetDatum(), RelationData::rd_att, RowExclusiveLock, table_close(), table_open(), validOperatorName(), and values.
Referenced by get_other_operator().
Definition at line 684 of file pg_operator.c.
References CatalogTupleUpdate(), CommandCounterIncrement(), ereport, errcode(), errmsg(), ERROR, get_opname(), GETSTRUCT, HeapTupleIsValid, InvalidOid, NameStr, ObjectIdGetDatum(), OidIsValid, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterOperator(), OperatorCreate(), and RemoveOperatorById().
void OperatorValidateParams | ( | Oid | leftTypeId, |
Oid | rightTypeId, | ||
Oid | operResultType, | ||
bool | hasCommutator, | ||
bool | hasNegator, | ||
bool | hasRestrictionSelectivity, | ||
bool | hasJoinSelectivity, | ||
bool | canMerge, | ||
bool | canHash | ||
) |
Definition at line 556 of file pg_operator.c.
References ereport, errcode(), errmsg(), ERROR, and OidIsValid.
Referenced by AlterOperator(), and OperatorCreate().
|
static |
Definition at line 68 of file pg_operator.c.
References len, name, and NAMEDATALEN.
Referenced by OperatorCreate(), and OperatorShellMake().