Commit a351679c authored by Tom Lane's avatar Tom Lane

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
parent 506652bc
...@@ -5969,8 +5969,8 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a ...@@ -5969,8 +5969,8 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a
MemSet(nulls, false, sizeof(nulls)); MemSet(nulls, false, sizeof(nulls));
MemSet(replace, false, sizeof(replace)); MemSet(replace, false, sizeof(replace));
values[Anum_pg_init_privs_privs - 1] = PointerGetDatum(new_acl); values[Anum_pg_init_privs_initprivs - 1] = PointerGetDatum(new_acl);
replace[Anum_pg_init_privs_privs - 1] = true; replace[Anum_pg_init_privs_initprivs - 1] = true;
oldtuple = heap_modify_tuple(oldtuple, RelationGetDescr(relation), oldtuple = heap_modify_tuple(oldtuple, RelationGetDescr(relation),
values, nulls, replace); values, nulls, replace);
...@@ -6007,7 +6007,7 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a ...@@ -6007,7 +6007,7 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a
values[Anum_pg_init_privs_privtype - 1] = values[Anum_pg_init_privs_privtype - 1] =
CharGetDatum(INITPRIVS_EXTENSION); 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); tuple = heap_form_tuple(RelationGetDescr(relation), values, nulls);
......
...@@ -69,7 +69,7 @@ typedef FormData_pg_init_privs * Form_pg_init_privs; ...@@ -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_classoid 2
#define Anum_pg_init_privs_objsubid 3 #define Anum_pg_init_privs_objsubid 3
#define Anum_pg_init_privs_privtype 4 #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 * It is important to know if the initial privileges are from initdb or from an
......
...@@ -58,9 +58,8 @@ typedef FormData_pg_tablespace *Form_pg_tablespace; ...@@ -58,9 +58,8 @@ typedef FormData_pg_tablespace *Form_pg_tablespace;
#define Anum_pg_tablespace_spcoptions 4 #define Anum_pg_tablespace_spcoptions 4
DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ )); DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ ));
DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ ));
#define DEFAULTTABLESPACE_OID 1663 #define DEFAULTTABLESPACE_OID 1663
DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ ));
#define GLOBALTABLESPACE_OID 1664 #define GLOBALTABLESPACE_OID 1664
#endif /* PG_TABLESPACE_H */ #endif /* PG_TABLESPACE_H */
...@@ -255,7 +255,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia ...@@ -255,7 +255,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
return ECPG_ARRAY_ERROR; return ECPG_ARRAY_ERROR;
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMETZOID, ECPG_ARRAY_NONE, stmt->lineno)) if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMETZOID, ECPG_ARRAY_NONE, stmt->lineno))
return ECPG_ARRAY_ERROR; 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; return ECPG_ARRAY_ERROR;
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARBITOID, ECPG_ARRAY_NONE, stmt->lineno)) if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARBITOID, ECPG_ARRAY_NONE, stmt->lineno))
return ECPG_ARRAY_ERROR; return ECPG_ARRAY_ERROR;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#define TIMESTAMPTZOID 1184 #define TIMESTAMPTZOID 1184
#define INTERVALOID 1186 #define INTERVALOID 1186
#define TIMETZOID 1266 #define TIMETZOID 1266
#define ZPBITOID 1560 #define BITOID 1560
#define VARBITOID 1562 #define VARBITOID 1562
#define NUMERICOID 1700 #define NUMERICOID 1700
#define REFCURSOROID 1790 #define REFCURSOROID 1790
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment