提交 9545eedf 编写于 作者: H Heikki Linnakangas

Use OID #defines from fmgroids.h, rather than adding them in pg_proc.h.

To reduce the diff vs. upstream in pg_proc.h a little bit.
上级 51a46a68
......@@ -16,6 +16,7 @@
#include "storage/smgr.h"
#include "utils/memutils.h"
#include "catalog/pg_authid.h"
#include "utils/fmgroids.h" /* include this before pg_am.h, for Am_btree */
#include "catalog/pg_am.h"
#include "catalog/pg_class.h"
#include "catalog/pg_index.h"
......
......@@ -20,6 +20,7 @@
#include "optimizer/predtest.h"
#include "optimizer/var.h"
#include "parser/parse_relation.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/datum.h"
#include "utils/syscache.h"
......@@ -3327,8 +3328,8 @@ pre_dispatch_function_evaluation_mutator(Node *node,
* QD will flush the xlog which will also flush any xlog writes that
* the sequence server might do.
*/
if (funcid == NEXTVAL_FUNC_OID || funcid == CURRVAL_FUNC_OID ||
funcid == SETVAL_FUNC_OID)
if (funcid == F_NEXTVAL_OID || funcid == F_CURRVAL_OID ||
funcid == F_SETVAL_OID)
{
ExecutorMarkTransactionUsesSequences();
is_seq_func = true;
......
......@@ -312,7 +312,7 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt,
for (i = 0; i < nindexes; i++)
{
if (Irel[i]->rd_am->aminsert == BTINSERT_OID)
if (Irel[i]->rd_rel->relam == BTREE_AM_OID)
_bt_validate_vacuum(Irel[i], onerel, OldestXmin);
}
}
......
......@@ -20,6 +20,7 @@
#include "parser/parse_coerce.h"
#include "lib/stringinfo.h"
#include "catalog/pg_operator.h"
#include "utils/fmgroids.h"
/**
* Static declarations
......@@ -302,7 +303,7 @@ static bool is_sirv_funcexpr(FuncExpr *fe)
* Function cannot be sequence related
*/
Oid funcid = fe->funcid;
res = res && !(funcid == NEXTVAL_FUNC_OID || funcid == CURRVAL_FUNC_OID || funcid == SETVAL_FUNC_OID);
res = res && !(funcid == F_NEXTVAL_OID || funcid == F_CURRVAL_OID || funcid == F_SETVAL_OID);
return res;
}
......
......@@ -522,7 +522,7 @@ dispatch_add_to_segment(int16 pridbid, int16 segdbid, ArrayType *fsmap)
* array_out caches data in flinfo, as we cannot just
* do a DirectFunctionCall1().
*/
fmgr_info(ARRAY_OUT_OID, &flinfo);
fmgr_info(F_ARRAY_OUT, &flinfo);
a = OutputFunctionCall(&flinfo, PointerGetDatum(fsmap));
appendStringInfo(q,
......
......@@ -141,9 +141,15 @@ DESCR("bitmap index access method");
/*
* Am_btree AM values for FormData_pg_am.
*
* The function oid definitions, F_*, are in fmgroids.h. We don't #include
* that here, because most users of pg_am.h don't need this. Also,
* fmgroids.h is generated as part of the build, so I'm not 100% sure if
* that might cause dependency problems. If you need Am_btree, do #include
* "utils/fmgroids.h" before including pg_am.h.
*/
#define Am_btree \
{"btree"}, 5, 1, true, true, true, true, true, true, false, true, true, BTINSERT_OID, BTBEGINSCAN_OID, BTGETTUPLE_OID, BTGETMULTI_OID, BTRESCAN_OID, BTENDSCAN_OID, BTMARKPOS_OID, BTRESTRPOS_OID, BTBUILD_OID, BTBULKDELETE_OID, BTVACUUMCLEANUP_OID, BTCOSTESTIMATE_OID, BTOPTIONS_OID
{"btree"}, 5, 1, true, true, true, true, true, true, false, true, true, F_BTINSERT, F_BTBEGINSCAN, F_BTGETTUPLE, F_BTGETMULTI, F_BTRESCAN, F_BTENDSCAN, F_BTMARKPOS, F_BTRESTRPOS, F_BTBUILD, F_BTBULKDELETE, F_BTVACUUMCLEANUP, F_BTCOSTESTIMATE, F_BTOPTIONS
#endif /* PG_AM_H */
......@@ -686,55 +686,30 @@ DESCR("convert float4 to int4");
DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 1 0 f f t f v 2 16 "2281 2281" _null_ _null_ _null_ btgettuple - _null_ _null_ ));
DESCR("btree(internal)");
#define BTGETTUPLE_OID 330
DATA(insert OID = 636 ( btgetmulti PGNSP PGUID 12 1 0 f f t f v 2 2281 "2281 2281" _null_ _null_ _null_ btgetmulti - _null_ _null_ ));
DESCR("btree(internal)");
#define BTGETMULTI_OID 636
DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 1 0 f f t f v 6 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ btinsert - _null_ _null_ ));
DESCR("btree(internal)");
#define BTINSERT_OID 331
DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 1 0 f f t f v 3 2281 "2281 2281 2281" _null_ _null_ _null_ btbeginscan - _null_ _null_ ));
DESCR("btree(internal)");
#define BTBEGINSCAN_OID 333
DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 1 0 f f t f v 2 2278 "2281 2281" _null_ _null_ _null_ btrescan - _null_ _null_ ));
DESCR("btree(internal)");
#define BTRESCAN_OID 334
DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 1 0 f f t f v 1 2278 "2281" _null_ _null_ _null_ btendscan - _null_ _null_ ));
DESCR("btree(internal)");
#define BTENDSCAN_OID 335
DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 1 0 f f t f v 1 2278 "2281" _null_ _null_ _null_ btmarkpos - _null_ _null_ ));
DESCR("btree(internal)");
#define BTMARKPOS_OID 336
DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 1 0 f f t f v 1 2278 "2281" _null_ _null_ _null_ btrestrpos - _null_ _null_ ));
DESCR("btree(internal)");
#define BTRESTRPOS_OID 337
DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 1 0 f f t f v 3 2281 "2281 2281 2281" _null_ _null_ _null_ btbuild - _null_ _null_ ));
DESCR("btree(internal)");
#define BTBUILD_OID 338
DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 1 0 f f t f v 4 2281 "2281 2281 2281 2281" _null_ _null_ _null_ btbulkdelete - _null_ _null_ ));
DESCR("btree(internal)");
#define BTBULKDELETE_OID 332
DATA(insert OID = 972 ( btvacuumcleanup PGNSP PGUID 12 1 0 f f t f v 2 2281 "2281 2281" _null_ _null_ _null_ btvacuumcleanup - _null_ _null_ ));
DESCR("btree(internal)");
#define BTVACUUMCLEANUP_OID 972
DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 1 0 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ btcostestimate - _null_ _null_ ));
DESCR("btree(internal)");
#define BTCOSTESTIMATE_OID 1268
DATA(insert OID = 2785 ( btoptions PGNSP PGUID 12 1 0 f f t f s 2 17 "1009 16" _null_ _null_ _null_ btoptions - _null_ _null_ ));
DESCR("btree(internal)");
#define BTOPTIONS_OID 2785
DATA(insert OID = 339 ( poly_same PGNSP PGUID 12 1 0 f f t f i 2 16 "604 604" _null_ _null_ _null_ poly_same - _null_ _null_ ));
DESCR("same as?");
......@@ -1049,7 +1024,6 @@ DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 1 0 f f t f i 1 25 "2277"
DESCR("array dimensions");
DATA(insert OID = 750 ( array_in PGNSP PGUID 12 1 0 f f t f s 3 2277 "2275 26 23" _null_ _null_ _null_ array_in - _null_ _null_ ));
DESCR("I/O");
#define ARRAY_OUT_OID 751
DATA(insert OID = 751 ( array_out PGNSP PGUID 12 1 0 f f t f s 1 2275 "2277" _null_ _null_ _null_ array_out - _null_ _null_ ));
DESCR("I/O");
DATA(insert OID = 2091 ( array_lower PGNSP PGUID 12 1 0 f f t f i 2 23 "2277 23" _null_ _null_ _null_ array_lower - _null_ _null_ ));
......@@ -2119,13 +2093,10 @@ DESCR("does not match LIKE expression");
/* SEQUENCE functions */
DATA(insert OID = 1574 ( nextval PGNSP PGUID 12 1 0 f f t f v 1 20 "2205" _null_ _null_ _null_ nextval_oid - _null_ _null_ ));
DESCR("sequence next value");
#define NEXTVAL_FUNC_OID 1574
DATA(insert OID = 1575 ( currval PGNSP PGUID 12 1 0 f f t f v 1 20 "2205" _null_ _null_ _null_ currval_oid - _null_ _null_ ));
DESCR("sequence current value");
#define CURRVAL_FUNC_OID 1575
DATA(insert OID = 1576 ( setval PGNSP PGUID 12 1 0 f f t f v 2 20 "2205 20" _null_ _null_ _null_ setval_oid - _null_ _null_ ));
DESCR("set sequence value");
#define SETVAL_FUNC_OID 1576
DATA(insert OID = 1765 ( setval PGNSP PGUID 12 1 0 f f t f v 3 20 "2205 20 16" _null_ _null_ _null_ setval3_oid - _null_ _null_ ));
DESCR("set sequence value and iscalled status");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册