From: Tom Lane Date: Sat, 3 Mar 2018 16:23:33 +0000 (-0500) Subject: Trivial adjustments in preparation for bootstrap data conversion. X-Git-Tag: REL_11_BETA1~664 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a351679c806ec9591ef4aaf5534d642e35140b9d;p=postgresql Trivial adjustments in preparation for bootstrap data conversion. Rationalize a couple of macro names: * In catalog/pg_init_privs.h, rename Anum_pg_init_privs_privs to Anum_pg_init_privs_initprivs to match the column's actual name. * In ecpg, rename ZPBITOID to BITOID to match catalog/pg_type.h. This reduces reader confusion, and will allow us to generate these macros automatically in future. In catalog/pg_tablespace.h, fix the ordering of related DATA and #define lines to agree with how it's done elsewhere. This has no impact today, but simplifies life for the bootstrap data conversion scripts. John Naylor Discussion: https://postgr.es/m/CAJVSVGXnLH=BSo0x-aA818f=MyQqGS5nM-GDCWAMdnvQJTRC1A@mail.gmail.com --- diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index 3f2c629c47..0648539796 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -5969,8 +5969,8 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a MemSet(nulls, false, sizeof(nulls)); MemSet(replace, false, sizeof(replace)); - values[Anum_pg_init_privs_privs - 1] = PointerGetDatum(new_acl); - replace[Anum_pg_init_privs_privs - 1] = true; + values[Anum_pg_init_privs_initprivs - 1] = PointerGetDatum(new_acl); + replace[Anum_pg_init_privs_initprivs - 1] = true; oldtuple = heap_modify_tuple(oldtuple, RelationGetDescr(relation), values, nulls, replace); @@ -6007,7 +6007,7 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a values[Anum_pg_init_privs_privtype - 1] = CharGetDatum(INITPRIVS_EXTENSION); - values[Anum_pg_init_privs_privs - 1] = PointerGetDatum(new_acl); + values[Anum_pg_init_privs_initprivs - 1] = PointerGetDatum(new_acl); tuple = heap_form_tuple(RelationGetDescr(relation), values, nulls); diff --git a/src/include/catalog/pg_init_privs.h b/src/include/catalog/pg_init_privs.h index 6ea005fdeb..65f02c2aef 100644 --- a/src/include/catalog/pg_init_privs.h +++ b/src/include/catalog/pg_init_privs.h @@ -69,7 +69,7 @@ typedef FormData_pg_init_privs * Form_pg_init_privs; #define Anum_pg_init_privs_classoid 2 #define Anum_pg_init_privs_objsubid 3 #define Anum_pg_init_privs_privtype 4 -#define Anum_pg_init_privs_privs 5 +#define Anum_pg_init_privs_initprivs 5 /* * It is important to know if the initial privileges are from initdb or from an diff --git a/src/include/catalog/pg_tablespace.h b/src/include/catalog/pg_tablespace.h index 3967056649..360fc4c0cc 100644 --- a/src/include/catalog/pg_tablespace.h +++ b/src/include/catalog/pg_tablespace.h @@ -58,9 +58,8 @@ typedef FormData_pg_tablespace *Form_pg_tablespace; #define Anum_pg_tablespace_spcoptions 4 DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ )); -DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ )); - #define DEFAULTTABLESPACE_OID 1663 +DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ )); #define GLOBALTABLESPACE_OID 1664 #endif /* PG_TABLESPACE_H */ diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 7d6d7d0754..0404385de9 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -255,7 +255,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia return ECPG_ARRAY_ERROR; if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMETZOID, ECPG_ARRAY_NONE, stmt->lineno)) return ECPG_ARRAY_ERROR; - if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), ZPBITOID, ECPG_ARRAY_NONE, stmt->lineno)) + if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BITOID, ECPG_ARRAY_NONE, stmt->lineno)) return ECPG_ARRAY_ERROR; if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARBITOID, ECPG_ARRAY_NONE, stmt->lineno)) return ECPG_ARRAY_ERROR; diff --git a/src/interfaces/ecpg/ecpglib/pg_type.h b/src/interfaces/ecpg/ecpglib/pg_type.h index 5d9eeca03a..f75c887888 100644 --- a/src/interfaces/ecpg/ecpglib/pg_type.h +++ b/src/interfaces/ecpg/ecpglib/pg_type.h @@ -54,7 +54,7 @@ #define TIMESTAMPTZOID 1184 #define INTERVALOID 1186 #define TIMETZOID 1266 -#define ZPBITOID 1560 +#define BITOID 1560 #define VARBITOID 1562 #define NUMERICOID 1700 #define REFCURSOROID 1790