]> granicus.if.org Git - postgresql/commitdiff
Trivial adjustments in preparation for bootstrap data conversion.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Mar 2018 16:23:33 +0000 (11:23 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Mar 2018 16:23:33 +0000 (11:23 -0500)
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

src/backend/catalog/aclchk.c
src/include/catalog/pg_init_privs.h
src/include/catalog/pg_tablespace.h
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/pg_type.h

index 3f2c629c472a045f35907a577a7ba8d64d64474b..06485397969843b0adb25df822aeb55c5f5a3d59 100644 (file)
@@ -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);
 
index 6ea005fdebfec0db4e933df1fb9b4bad7103cc03..65f02c2aefe080976e0f61d0bdf26c90dd849ad7 100644 (file)
@@ -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
index 39670566499e4298243e29d7a2a6a08e1c271206..360fc4c0cc404e190d5846e64f6ad728fdbaf61d 100644 (file)
@@ -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 */
index 7d6d7d0754c4890bb1b0820fa44b2b7f13465fe1..0404385de9806b17f565a72d8281b6f155506ca0 100644 (file)
@@ -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;
index 5d9eeca03a7b9cfbfb0799e54765f01717e69919..f75c8878882b026e368cae595dd89569619f57fa 100644 (file)
@@ -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