From 97ac8f7ffc05c8465ace56cf6e466bc77981b885 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 20 Jul 1998 19:21:45 +0000 Subject: [PATCH] Use defines rather than constants for types. --- src/backend/catalog/heap.c | 14 +++++++------- src/backend/catalog/index.c | 14 +++++++------- src/backend/optimizer/prep/preptlist.c | 6 +++--- src/include/catalog/pg_type.h | 8 +++++++- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index d14b51d6fc..a476d34e48 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.53 1998/07/20 11:28:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.54 1998/07/20 19:21:41 momjian Exp $ * * INTERFACE ROUTINES * heap_create() - Create an uncataloged heap relation @@ -97,32 +97,32 @@ static void RemoveConstraints(Relation rel); */ static FormData_pg_attribute a1 = { - 0xffffffff, {"ctid"}, 27, 0, sizeof(ItemPointerData), + 0xffffffff, {"ctid"}, TIDOID, 0, sizeof(ItemPointerData), SelfItemPointerAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0' }; static FormData_pg_attribute a2 = { - 0xffffffff, {"oid"}, 26, 0, sizeof(Oid), + 0xffffffff, {"oid"}, OIDOID, 0, sizeof(Oid), ObjectIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0' }; static FormData_pg_attribute a3 = { - 0xffffffff, {"xmin"}, 28, 0, sizeof(TransactionId), + 0xffffffff, {"xmin"}, XIDOID, 0, sizeof(TransactionId), MinTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0' }; static FormData_pg_attribute a4 = { - 0xffffffff, {"cmin"}, 29, 0, sizeof(CommandId), + 0xffffffff, {"cmin"}, CIDOID, 0, sizeof(CommandId), MinCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0' }; static FormData_pg_attribute a5 = { - 0xffffffff, {"xmax"}, 28, 0, sizeof(TransactionId), + 0xffffffff, {"xmax"}, XIDOID, 0, sizeof(TransactionId), MaxTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0' }; static FormData_pg_attribute a6 = { - 0xffffffff, {"cmax"}, 29, 0, sizeof(CommandId), + 0xffffffff, {"cmax"}, CIDOID, 0, sizeof(CommandId), MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0' }; diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 39639c0738..c81f14a4f1 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.45 1998/07/12 23:41:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.46 1998/07/20 19:21:42 momjian Exp $ * * * INTERFACE ROUTINES @@ -118,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation, * ---------------------------------------------------------------- */ static FormData_pg_attribute sysatts[] = { - {0, {"ctid"}, 27, 0, 6, -1, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, - {0, {"oid"}, 26, 0, 4, -2, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, - {0, {"xmin"}, 28, 0, 4, -3, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, - {0, {"cmin"}, 29, 0, 4, -4, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, - {0, {"xmax"}, 28, 0, 4, -5, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, - {0, {"cmax"}, 29, 0, 4, -6, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, + {0, {"ctid"}, TIDOID, 0, 6, -1, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, + {0, {"oid"}, OIDOID, 0, 4, -2, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, + {0, {"xmin"}, XIDOID, 0, 4, -3, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, + {0, {"cmin"}, CIDOID, 0, 4, -4, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, + {0, {"xmax"}, XIDOID, 0, 4, -5, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'}, + {0, {"cmax"}, CIDOID, 0, 4, -6, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'}, }; /* ---------------------------------------------------------------- diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c index f5eb33db22..e8dc816de9 100644 --- a/src/backend/optimizer/prep/preptlist.c +++ b/src/backend/optimizer/prep/preptlist.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.12 1998/07/12 21:29:17 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.13 1998/07/20 19:21:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -105,14 +105,14 @@ preprocess_targetlist(List *tlist, Var *var; resdom = makeResdom(length(t_list) + 1, - 27, + TIDOID, -1, "ctid", 0, 0, 1); - var = makeVar(result_relation, -1, 27, -1, 0, result_relation, -1); + var = makeVar(result_relation, -1, TIDOID, -1, 0, result_relation, -1); ctid = makeNode(TargetEntry); ctid->resdom = resdom; diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index fd2418cf7d..71bca3c013 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.41 1998/07/08 14:09:00 thomas Exp $ + * $Id: pg_type.h,v 1.42 1998/07/20 19:21:45 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -201,10 +201,16 @@ DESCR("object identifier type"); DATA(insert OID = 27 ( tid PGUID 6 19 f b t \054 0 0 tidin tidout tidin tidout i _null_ )); DESCR("tuple identifier type, physical location of tuple"); +#define TIDOID 27 + DATA(insert OID = 28 ( xid PGUID 4 12 t b t \054 0 0 xidin xidout xidin xidout i _null_ )); DESCR("transaction id"); +#define XIDOID 28 + DATA(insert OID = 29 ( cid PGUID 4 10 t b t \054 0 0 cidin cidout cidin cidout i _null_ )); DESCR("command identifier type, sequence in transaction id"); +#define CIDOID 29 + DATA(insert OID = 30 ( oid8 PGUID 32 89 f b t \054 0 26 oid8in oid8out oid8in oid8out i _null_ )); DESCR("array of 8 oid, used in system tables"); DATA(insert OID = 32 ( SET PGUID -1 -1 f r t \054 0 -1 textin textout textin textout i _null_ )); -- 2.40.0