mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.
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
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_aggregate_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* pg_aggregate definition.
|
||||
* cpp turns this into typedef struct FormData_pg_aggregate
|
||||
@@ -136,4 +139,37 @@ typedef FormData_pg_aggregate *Form_pg_aggregate;
|
||||
|
||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||
|
||||
|
||||
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_H */
|
||||
|
||||
@@ -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 */
|
||||
@@ -57,4 +57,15 @@ typedef FormData_pg_collation *Form_pg_collation;
|
||||
|
||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||
|
||||
|
||||
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_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 */
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_constraint_d.h"
|
||||
|
||||
#include "catalog/dependency.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_constraint definition. cpp turns this into
|
||||
* typedef struct FormData_pg_constraint
|
||||
@@ -174,4 +177,89 @@ typedef FormData_pg_constraint *Form_pg_constraint;
|
||||
|
||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||
|
||||
/*
|
||||
* 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_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 */
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_conversion_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* pg_conversion definition.
|
||||
*
|
||||
@@ -53,4 +55,13 @@ CATALOG(pg_conversion,2607,ConversionRelationId)
|
||||
*/
|
||||
typedef FormData_pg_conversion *Form_pg_conversion;
|
||||
|
||||
|
||||
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_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 */
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_db_role_setting_d.h"
|
||||
|
||||
#include "utils/guc.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/snapshot.h"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_enum_d.h"
|
||||
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_inherits_d.h"
|
||||
|
||||
#include "nodes/pg_list.h"
|
||||
#include "storage/lock.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_inherits definition. cpp turns this into
|
||||
* typedef struct FormData_pg_inherits
|
||||
@@ -40,4 +43,15 @@ CATALOG(pg_inherits,2611,InheritsRelationId) BKI_WITHOUT_OIDS
|
||||
*/
|
||||
typedef FormData_pg_inherits *Form_pg_inherits;
|
||||
|
||||
|
||||
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_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 */
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_operator_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_operator definition. cpp turns this into
|
||||
* typedef struct FormData_pg_operator
|
||||
@@ -78,4 +81,21 @@ CATALOG(pg_operator,2617,OperatorRelationId)
|
||||
*/
|
||||
typedef FormData_pg_operator *Form_pg_operator;
|
||||
|
||||
|
||||
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_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 */
|
||||
@@ -20,6 +20,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_proc_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_proc definition. cpp turns this into
|
||||
* typedef struct FormData_pg_proc
|
||||
@@ -172,4 +175,35 @@ typedef FormData_pg_proc *Form_pg_proc;
|
||||
|
||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||
|
||||
|
||||
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_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 */
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_publication_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
|
||||
/* ----------------
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_replication_origin_d.h"
|
||||
|
||||
#include "access/xlogdefs.h"
|
||||
|
||||
/* ----------------
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_subscription_d.h"
|
||||
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
/* ----------------
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_subscription_rel_d.h"
|
||||
|
||||
#include "access/xlogdefs.h"
|
||||
#include "nodes/pg_list.h"
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "catalog/genbki.h"
|
||||
#include "catalog/pg_type_d.h"
|
||||
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "nodes/nodes.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_type definition. cpp turns this into
|
||||
* typedef struct FormData_pg_type
|
||||
@@ -282,4 +285,68 @@ typedef FormData_pg_type *Form_pg_type;
|
||||
|
||||
#endif /* EXPOSE_TO_CLIENT_CODE */
|
||||
|
||||
|
||||
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_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 */
|
||||
Reference in New Issue
Block a user