]> granicus.if.org Git - postgresql/commitdiff
Don't include utils/array.h from acl.h.
authorAndres Freund <andres@anarazel.de>
Fri, 16 Aug 2019 17:33:30 +0000 (10:33 -0700)
committerAndres Freund <andres@anarazel.de>
Fri, 16 Aug 2019 17:33:30 +0000 (10:33 -0700)
For most uses of acl.h the details of how "Acl" internally looks like
are irrelevant. It might make sense to move a lot of the
implementation details into a separate header at a later point.

The main motivation of this change is to avoid including fmgr.h (via
array.h, which needs it for exposed structs) in a lot of files that
otherwise don't need it. A subsequent commit will remove the fmgr.h
include from a lot of files.

Directly include utils/array.h and utils/expandeddatum.h from the
files that need them, but previously included them indirectly, via
acl.h.

Author: Andres Freund
Discussion: https://postgr.es/m/20190803193733.g3l3x3o42uv4qj7l@alap3.anarazel.de

14 files changed:
contrib/pageinspect/hashfuncs.c
src/backend/executor/execExpr.c
src/backend/executor/execExprInterp.c
src/backend/executor/execTuples.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeWindowAgg.c
src/backend/partitioning/partprune.c
src/backend/statistics/extended_stats.c
src/backend/statistics/mcv.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/tsvector_op.c
src/include/catalog/objectaddress.h
src/include/utils/acl.h
src/include/utils/array.h

index e69913302ac3e98a0539c1b208437c47b7db0106..9374c4aabc4c41445abfe4e3adb3a77034deea27 100644 (file)
@@ -18,6 +18,7 @@
 #include "catalog/pg_am.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
 
index 6d09f2a21812c4868b7928523fca7dfd26318250..58e2432aac71ab6b75a25c22a27370a84ded6434 100644 (file)
@@ -42,6 +42,7 @@
 #include "nodes/nodeFuncs.h"
 #include "optimizer/optimizer.h"
 #include "pgstat.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/datum.h"
 #include "utils/lsyscache.h"
index 66a67c72b29a4287641f6b322c762b353c08b5be..d61f75bc3b6556a7f5920d81cf73ec950562a799 100644 (file)
@@ -62,6 +62,7 @@
 #include "executor/execExpr.h"
 #include "executor/nodeSubplan.h"
 #include "funcapi.h"
+#include "utils/array.h"
 #include "utils/memutils.h"
 #include "miscadmin.h"
 #include "nodes/nodeFuncs.h"
index 5ee2a464bb448c213e40b2c66acd9067cde69152..697f1fed71d4f6aa5a4145d6e83e60ffabb48f89 100644 (file)
@@ -65,6 +65,7 @@
 #include "nodes/nodeFuncs.h"
 #include "storage/bufmgr.h"
 #include "utils/builtins.h"
+#include "utils/expandeddatum.h"
 #include "utils/lsyscache.h"
 #include "utils/typcache.h"
 
index a9a1fd022a50e8138d6e11be45d9c7095eb29033..58c376aeb745db251b8ad4e83f1f0b71bed5f1eb 100644 (file)
 #include "parser/parse_coerce.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/expandeddatum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/syscache.h"
index cb81357304474ebaec92fb090ab53a65949b1cb1..b5d3f3c4219254ee8ccfda06d099cb5f28194159 100644 (file)
@@ -46,6 +46,7 @@
 #include "parser/parse_coerce.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/expandeddatum.h"
 #include "utils/datum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
index 44bcff2d08744a6af44d2ff169d6d6bf151ed88d..29f1c11b242c4cd222b99f55e23c4838fae42d98 100644 (file)
@@ -53,6 +53,7 @@
 #include "partitioning/partbounds.h"
 #include "partitioning/partprune.h"
 #include "rewrite/rewriteManip.h"
+#include "utils/array.h"
 #include "utils/lsyscache.h"
 
 
index 23c74f7d90a72618566b25cadcc4c1c2b083b746..48f17ba8d564b8902139e2c6cd09aae70f8787c4 100644 (file)
@@ -31,6 +31,7 @@
 #include "postmaster/autovacuum.h"
 #include "statistics/extended_stats_internal.h"
 #include "statistics/statistics.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
index cec06f8c444eebf1ec6a75ad06644522d3a539d6..bae6f219684280d197f49d42dd840d08368c03b8 100644 (file)
@@ -26,6 +26,7 @@
 #include "optimizer/clauses.h"
 #include "statistics/extended_stats_internal.h"
 #include "statistics/statistics.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/bytea.h"
 #include "utils/fmgroids.h"
index cfd139e6e928c14b8f3c87edb46bbffa34164718..d7e6100ccbf8c8f3b59348ed2e0df8b4e181ba71 100644 (file)
@@ -30,6 +30,7 @@
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
 #include "utils/hashutils.h"
index 696a7fdf914689e7d3a9fe88bc88528f9cfff466..28d042273e3b572dd4afe5ada859931a8381228a 100644 (file)
@@ -25,6 +25,7 @@
 #include "miscadmin.h"
 #include "parser/parse_coerce.h"
 #include "tsearch/ts_utils.h"
+#include "utils/array.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/regproc.h"
index 95cc3158683702ddfa5d87e1dd8c440967526c10..7e61569f9fe87e261af3208fdbbc97e84c24b366 100644 (file)
@@ -77,7 +77,7 @@ extern char *getObjectTypeDescription(const ObjectAddress *object);
 extern char *getObjectIdentity(const ObjectAddress *address);
 extern char *getObjectIdentityParts(const ObjectAddress *address,
                                                                        List **objname, List **objargs);
-extern ArrayType *strlist_to_textarray(List *list);
+extern struct ArrayType *strlist_to_textarray(List *list);
 
 extern ObjectType get_relkind_objtype(char relkind);
 
index f4c160ee7238976f45e80194c8fba991081cf656..b99da737283a4287a5840eae98a3efe48500e48d 100644 (file)
@@ -35,7 +35,6 @@
 #include "access/htup.h"
 #include "nodes/parsenodes.h"
 #include "parser/parse_node.h"
-#include "utils/array.h"
 #include "utils/snapshot.h"
 
 
@@ -104,7 +103,7 @@ typedef struct AclItem
 /*
  * Acl                 a one-dimensional array of AclItem
  */
-typedef ArrayType Acl;
+typedef struct ArrayType Acl;
 
 #define ACL_NUM(ACL)                   (ARR_DIMS(ACL)[0])
 #define ACL_DAT(ACL)                   ((AclItem *) ARR_DATA_PTR(ACL))
index b441eb452b94a71c92e2f174a6e657a6b57e7e7b..5cfafe00457efc269be70bedcc350113f6edc184 100644 (file)
@@ -77,7 +77,7 @@ struct ExprContext;
  * CAUTION: if you change the header for ordinary arrays you will also
  * need to change the headers for oidvector and int2vector!
  */
-typedef struct
+typedef struct ArrayType
 {
        int32           vl_len_;                /* varlena header (do not touch directly!) */
        int                     ndim;                   /* # of dimensions */