mirror of https://github.com/postgres/postgres
Traditionally, include/catalog/pg_foo.h contains extern declarations
for functions in backend/catalog/pg_foo.c, in addition to its function
as the authoritative definition of the pg_foo catalog's rowtype.
In some cases, we'd been forced to split out those extern declarations
into separate pg_foo_fn.h headers so that the catalog definitions
could be #include'd by frontend code. That problem is gone as of
commit 9c0a0de4c
, so let's undo the splits to make things less
confusing.
Discussion: https://postgr.es/m/23690.1523031777@sss.pgh.pa.us
pull/27/merge
parent
9c0a0de4c9
commit
cefa387153
@ -1,52 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_aggregate_fn.h |
|
||||||
* prototypes for functions in catalog/pg_aggregate.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_aggregate_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_AGGREGATE_FN_H |
|
||||||
#define PG_AGGREGATE_FN_H |
|
||||||
|
|
||||||
#include "catalog/objectaddress.h" |
|
||||||
#include "nodes/pg_list.h" |
|
||||||
|
|
||||||
extern ObjectAddress AggregateCreate(const char *aggName, |
|
||||||
Oid aggNamespace, |
|
||||||
char aggKind, |
|
||||||
int numArgs, |
|
||||||
int numDirectArgs, |
|
||||||
oidvector *parameterTypes, |
|
||||||
Datum allParameterTypes, |
|
||||||
Datum parameterModes, |
|
||||||
Datum parameterNames, |
|
||||||
List *parameterDefaults, |
|
||||||
Oid variadicArgType, |
|
||||||
List *aggtransfnName, |
|
||||||
List *aggfinalfnName, |
|
||||||
List *aggcombinefnName, |
|
||||||
List *aggserialfnName, |
|
||||||
List *aggdeserialfnName, |
|
||||||
List *aggmtransfnName, |
|
||||||
List *aggminvtransfnName, |
|
||||||
List *aggmfinalfnName, |
|
||||||
bool finalfnExtraArgs, |
|
||||||
bool mfinalfnExtraArgs, |
|
||||||
char finalfnModify, |
|
||||||
char mfinalfnModify, |
|
||||||
List *aggsortopName, |
|
||||||
Oid aggTransType, |
|
||||||
int32 aggTransSpace, |
|
||||||
Oid aggmTransType, |
|
||||||
int32 aggmTransSpace, |
|
||||||
const char *agginitval, |
|
||||||
const char *aggminitval, |
|
||||||
char proparallel); |
|
||||||
|
|
||||||
#endif /* PG_AGGREGATE_FN_H */ |
|
@ -1,27 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_collation_fn.h |
|
||||||
* prototypes for functions in catalog/pg_collation.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_collation_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_COLLATION_FN_H |
|
||||||
#define PG_COLLATION_FN_H |
|
||||||
|
|
||||||
extern Oid CollationCreate(const char *collname, Oid collnamespace, |
|
||||||
Oid collowner, |
|
||||||
char collprovider, |
|
||||||
int32 collencoding, |
|
||||||
const char *collcollate, const char *collctype, |
|
||||||
const char *collversion, |
|
||||||
bool if_not_exists, |
|
||||||
bool quiet); |
|
||||||
extern void RemoveCollationById(Oid collationOid); |
|
||||||
|
|
||||||
#endif /* PG_COLLATION_FN_H */ |
|
@ -1,104 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_constraint_fn.h |
|
||||||
* prototypes for functions in catalog/pg_constraint.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_constraint_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_CONSTRAINT_FN_H |
|
||||||
#define PG_CONSTRAINT_FN_H |
|
||||||
|
|
||||||
#include "catalog/dependency.h" |
|
||||||
#include "nodes/pg_list.h" |
|
||||||
|
|
||||||
/*
|
|
||||||
* Identify constraint type for lookup purposes |
|
||||||
*/ |
|
||||||
typedef enum ConstraintCategory |
|
||||||
{ |
|
||||||
CONSTRAINT_RELATION, |
|
||||||
CONSTRAINT_DOMAIN, |
|
||||||
CONSTRAINT_ASSERTION /* for future expansion */ |
|
||||||
} ConstraintCategory; |
|
||||||
|
|
||||||
/*
|
|
||||||
* Used when cloning a foreign key constraint to a partition, so that the |
|
||||||
* caller can optionally set up a verification pass for it. |
|
||||||
*/ |
|
||||||
typedef struct ClonedConstraint |
|
||||||
{ |
|
||||||
Oid relid; |
|
||||||
Oid refrelid; |
|
||||||
Oid conindid; |
|
||||||
Oid conid; |
|
||||||
Constraint *constraint; |
|
||||||
} ClonedConstraint; |
|
||||||
|
|
||||||
extern Oid CreateConstraintEntry(const char *constraintName, |
|
||||||
Oid constraintNamespace, |
|
||||||
char constraintType, |
|
||||||
bool isDeferrable, |
|
||||||
bool isDeferred, |
|
||||||
bool isValidated, |
|
||||||
Oid parentConstrId, |
|
||||||
Oid relId, |
|
||||||
const int16 *constraintKey, |
|
||||||
int constraintNKeys, |
|
||||||
int constraintNTotalKeys, |
|
||||||
Oid domainId, |
|
||||||
Oid indexRelId, |
|
||||||
Oid foreignRelId, |
|
||||||
const int16 *foreignKey, |
|
||||||
const Oid *pfEqOp, |
|
||||||
const Oid *ppEqOp, |
|
||||||
const Oid *ffEqOp, |
|
||||||
int foreignNKeys, |
|
||||||
char foreignUpdateType, |
|
||||||
char foreignDeleteType, |
|
||||||
char foreignMatchType, |
|
||||||
const Oid *exclOp, |
|
||||||
Node *conExpr, |
|
||||||
const char *conBin, |
|
||||||
const char *conSrc, |
|
||||||
bool conIsLocal, |
|
||||||
int conInhCount, |
|
||||||
bool conNoInherit, |
|
||||||
bool is_internal); |
|
||||||
|
|
||||||
extern void CloneForeignKeyConstraints(Oid parentId, Oid relationId, |
|
||||||
List **cloned); |
|
||||||
|
|
||||||
extern void RemoveConstraintById(Oid conId); |
|
||||||
extern void RenameConstraintById(Oid conId, const char *newname); |
|
||||||
|
|
||||||
extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId, |
|
||||||
Oid objNamespace, const char *conname); |
|
||||||
extern char *ChooseConstraintName(const char *name1, const char *name2, |
|
||||||
const char *label, Oid namespaceid, |
|
||||||
List *others); |
|
||||||
|
|
||||||
extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, |
|
||||||
Oid newNspId, bool isType, ObjectAddresses *objsMoved); |
|
||||||
extern void ConstraintSetParentConstraint(Oid childConstrId, |
|
||||||
Oid parentConstrId); |
|
||||||
extern Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok); |
|
||||||
extern Bitmapset *get_relation_constraint_attnos(Oid relid, const char *conname, |
|
||||||
bool missing_ok, Oid *constraintOid); |
|
||||||
extern Oid get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok); |
|
||||||
extern Oid get_relation_idx_constraint_oid(Oid relationId, Oid indexId); |
|
||||||
|
|
||||||
extern Bitmapset *get_primary_key_attnos(Oid relid, bool deferrableOk, |
|
||||||
Oid *constraintOid); |
|
||||||
|
|
||||||
extern bool check_functional_grouping(Oid relid, |
|
||||||
Index varno, Index varlevelsup, |
|
||||||
List *grouping_columns, |
|
||||||
List **constraintDeps); |
|
||||||
|
|
||||||
#endif /* PG_CONSTRAINT_FN_H */ |
|
@ -1,27 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_conversion_fn.h |
|
||||||
* prototypes for functions in catalog/pg_conversion.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_conversion_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_CONVERSION_FN_H |
|
||||||
#define PG_CONVERSION_FN_H |
|
||||||
|
|
||||||
|
|
||||||
#include "catalog/objectaddress.h" |
|
||||||
|
|
||||||
extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace, |
|
||||||
Oid conowner, |
|
||||||
int32 conforencoding, int32 contoencoding, |
|
||||||
Oid conproc, bool def); |
|
||||||
extern void RemoveConversionById(Oid conversionOid); |
|
||||||
extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding); |
|
||||||
|
|
||||||
#endif /* PG_CONVERSION_FN_H */ |
|
@ -1,30 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_inherits_fn.h |
|
||||||
* prototypes for functions in catalog/pg_inherits.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_inherits_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_INHERITS_FN_H |
|
||||||
#define PG_INHERITS_FN_H |
|
||||||
|
|
||||||
#include "nodes/pg_list.h" |
|
||||||
#include "storage/lock.h" |
|
||||||
|
|
||||||
extern List *find_inheritance_children(Oid parentrelId, LOCKMODE lockmode); |
|
||||||
extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, |
|
||||||
List **parents); |
|
||||||
extern bool has_subclass(Oid relationId); |
|
||||||
extern bool has_superclass(Oid relationId); |
|
||||||
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); |
|
||||||
extern void StoreSingleInheritance(Oid relationId, Oid parentOid, |
|
||||||
int32 seqNumber); |
|
||||||
extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent); |
|
||||||
|
|
||||||
#endif /* PG_INHERITS_FN_H */ |
|
@ -1,36 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_operator_fn.h |
|
||||||
* prototypes for functions in catalog/pg_operator.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_operator_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_OPERATOR_FN_H |
|
||||||
#define PG_OPERATOR_FN_H |
|
||||||
|
|
||||||
#include "catalog/objectaddress.h" |
|
||||||
#include "nodes/pg_list.h" |
|
||||||
|
|
||||||
extern 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); |
|
||||||
|
|
||||||
extern ObjectAddress makeOperatorDependencies(HeapTuple tuple, bool isUpdate); |
|
||||||
|
|
||||||
extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete); |
|
||||||
|
|
||||||
#endif /* PG_OPERATOR_FN_H */ |
|
@ -1,50 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_proc_fn.h |
|
||||||
* prototypes for functions in catalog/pg_proc.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_proc_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_PROC_FN_H |
|
||||||
#define PG_PROC_FN_H |
|
||||||
|
|
||||||
#include "catalog/objectaddress.h" |
|
||||||
#include "nodes/pg_list.h" |
|
||||||
|
|
||||||
extern ObjectAddress ProcedureCreate(const char *procedureName, |
|
||||||
Oid procNamespace, |
|
||||||
bool replace, |
|
||||||
bool returnsSet, |
|
||||||
Oid returnType, |
|
||||||
Oid proowner, |
|
||||||
Oid languageObjectId, |
|
||||||
Oid languageValidator, |
|
||||||
const char *prosrc, |
|
||||||
const char *probin, |
|
||||||
char prokind, |
|
||||||
bool security_definer, |
|
||||||
bool isLeakProof, |
|
||||||
bool isStrict, |
|
||||||
char volatility, |
|
||||||
char parallel, |
|
||||||
oidvector *parameterTypes, |
|
||||||
Datum allParameterTypes, |
|
||||||
Datum parameterModes, |
|
||||||
Datum parameterNames, |
|
||||||
List *parameterDefaults, |
|
||||||
Datum trftypes, |
|
||||||
Datum proconfig, |
|
||||||
float4 procost, |
|
||||||
float4 prorows); |
|
||||||
|
|
||||||
extern bool function_parse_error_transpose(const char *prosrc); |
|
||||||
|
|
||||||
extern List *oid_array_to_list(Datum datum); |
|
||||||
|
|
||||||
#endif /* PG_PROC_FN_H */ |
|
@ -1,84 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* pg_type_fn.h |
|
||||||
* prototypes for functions in catalog/pg_type.c |
|
||||||
* |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/catalog/pg_type_fn.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef PG_TYPE_FN_H |
|
||||||
#define PG_TYPE_FN_H |
|
||||||
|
|
||||||
#include "catalog/objectaddress.h" |
|
||||||
#include "nodes/nodes.h" |
|
||||||
|
|
||||||
|
|
||||||
extern ObjectAddress TypeShellMake(const char *typeName, |
|
||||||
Oid typeNamespace, |
|
||||||
Oid ownerId); |
|
||||||
|
|
||||||
extern ObjectAddress TypeCreate(Oid newTypeOid, |
|
||||||
const char *typeName, |
|
||||||
Oid typeNamespace, |
|
||||||
Oid relationOid, |
|
||||||
char relationKind, |
|
||||||
Oid ownerId, |
|
||||||
int16 internalSize, |
|
||||||
char typeType, |
|
||||||
char typeCategory, |
|
||||||
bool typePreferred, |
|
||||||
char typDelim, |
|
||||||
Oid inputProcedure, |
|
||||||
Oid outputProcedure, |
|
||||||
Oid receiveProcedure, |
|
||||||
Oid sendProcedure, |
|
||||||
Oid typmodinProcedure, |
|
||||||
Oid typmodoutProcedure, |
|
||||||
Oid analyzeProcedure, |
|
||||||
Oid elementType, |
|
||||||
bool isImplicitArray, |
|
||||||
Oid arrayType, |
|
||||||
Oid baseType, |
|
||||||
const char *defaultTypeValue, |
|
||||||
char *defaultTypeBin, |
|
||||||
bool passedByValue, |
|
||||||
char alignment, |
|
||||||
char storage, |
|
||||||
int32 typeMod, |
|
||||||
int32 typNDims, |
|
||||||
bool typeNotNull, |
|
||||||
Oid typeCollation); |
|
||||||
|
|
||||||
extern void GenerateTypeDependencies(Oid typeNamespace, |
|
||||||
Oid typeObjectId, |
|
||||||
Oid relationOid, |
|
||||||
char relationKind, |
|
||||||
Oid owner, |
|
||||||
Oid inputProcedure, |
|
||||||
Oid outputProcedure, |
|
||||||
Oid receiveProcedure, |
|
||||||
Oid sendProcedure, |
|
||||||
Oid typmodinProcedure, |
|
||||||
Oid typmodoutProcedure, |
|
||||||
Oid analyzeProcedure, |
|
||||||
Oid elementType, |
|
||||||
bool isImplicitArray, |
|
||||||
Oid baseType, |
|
||||||
Oid typeCollation, |
|
||||||
Node *defaultExpr, |
|
||||||
bool rebuild); |
|
||||||
|
|
||||||
extern void RenameTypeInternal(Oid typeOid, const char *newTypeName, |
|
||||||
Oid typeNamespace); |
|
||||||
|
|
||||||
extern char *makeArrayTypeName(const char *typeName, Oid typeNamespace); |
|
||||||
|
|
||||||
extern bool moveArrayTypeName(Oid typeOid, const char *typeName, |
|
||||||
Oid typeNamespace); |
|
||||||
|
|
||||||
#endif /* PG_TYPE_FN_H */ |
|
Loading…
Reference in new issue