Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a351679

Browse files
committed
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
1 parent 506652b commit a351679

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

src/backend/catalog/aclchk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5969,8 +5969,8 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a
59695969
MemSet(nulls, false, sizeof(nulls));
59705970
MemSet(replace, false, sizeof(replace));
59715971

5972-
values[Anum_pg_init_privs_privs - 1] = PointerGetDatum(new_acl);
5973-
replace[Anum_pg_init_privs_privs - 1] = true;
5972+
values[Anum_pg_init_privs_initprivs - 1] = PointerGetDatum(new_acl);
5973+
replace[Anum_pg_init_privs_initprivs - 1] = true;
59745974

59755975
oldtuple = heap_modify_tuple(oldtuple, RelationGetDescr(relation),
59765976
values, nulls, replace);
@@ -6007,7 +6007,7 @@ recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, Acl *new_a
60076007
values[Anum_pg_init_privs_privtype - 1] =
60086008
CharGetDatum(INITPRIVS_EXTENSION);
60096009

6010-
values[Anum_pg_init_privs_privs - 1] = PointerGetDatum(new_acl);
6010+
values[Anum_pg_init_privs_initprivs - 1] = PointerGetDatum(new_acl);
60116011

60126012
tuple = heap_form_tuple(RelationGetDescr(relation), values, nulls);
60136013

src/include/catalog/pg_init_privs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef FormData_pg_init_privs * Form_pg_init_privs;
6969
#define Anum_pg_init_privs_classoid 2
7070
#define Anum_pg_init_privs_objsubid 3
7171
#define Anum_pg_init_privs_privtype 4
72-
#define Anum_pg_init_privs_privs 5
72+
#define Anum_pg_init_privs_initprivs 5
7373

7474
/*
7575
* It is important to know if the initial privileges are from initdb or from an

src/include/catalog/pg_tablespace.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ typedef FormData_pg_tablespace *Form_pg_tablespace;
5858
#define Anum_pg_tablespace_spcoptions 4
5959

6060
DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ ));
61-
DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ ));
62-
6361
#define DEFAULTTABLESPACE_OID 1663
62+
DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ ));
6463
#define GLOBALTABLESPACE_OID 1664
6564

6665
#endif /* PG_TABLESPACE_H */

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
255255
return ECPG_ARRAY_ERROR;
256256
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMETZOID, ECPG_ARRAY_NONE, stmt->lineno))
257257
return ECPG_ARRAY_ERROR;
258-
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), ZPBITOID, ECPG_ARRAY_NONE, stmt->lineno))
258+
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BITOID, ECPG_ARRAY_NONE, stmt->lineno))
259259
return ECPG_ARRAY_ERROR;
260260
if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARBITOID, ECPG_ARRAY_NONE, stmt->lineno))
261261
return ECPG_ARRAY_ERROR;

src/interfaces/ecpg/ecpglib/pg_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#define TIMESTAMPTZOID 1184
5555
#define INTERVALOID 1186
5656
#define TIMETZOID 1266
57-
#define ZPBITOID 1560
57+
#define BITOID 1560
5858
#define VARBITOID 1562
5959
#define NUMERICOID 1700
6060
#define REFCURSOROID 1790

0 commit comments

Comments
 (0)