summaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
authorPeter Eisentraut2023-10-26 07:16:25 +0000
committerPeter Eisentraut2023-10-26 07:20:54 +0000
commit611806cd726fc92989ac918eac48fd8d684869c7 (patch)
tree4ed4dc6fc9a1c5825bf42072e28312440484db28 /src/backend/commands
parentf0efa5aec19358e2282d4968a03db1db56f0ac3f (diff)
Add trailing commas to enum definitions
Since C99, there can be a trailing comma after the last value in an enum definition. A lot of new code has been introducing this style on the fly. Some new patches are now taking an inconsistent approach to this. Some add the last comma on the fly if they add a new last value, some are trying to preserve the existing style in each place, some are even dropping the last comma if there was one. We could nudge this all in a consistent direction if we just add the trailing commas everywhere once. I omitted a few places where there was a fixed "last" value that will always stay last. I also skipped the header files of libpq and ecpg, in case people want to use those with older compilers. There were also a small number of cases where the enum type wasn't used anywhere (but the enum values were), which ended up confusing pgindent a bit, so I left those alone. Discussion: https://www.postgresql.org/message-id/flat/386f8c45-c8ac-4681-8add-e3b0852c1620%40eisentraut.org
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/async.c2
-rw-r--r--src/backend/commands/copyto.c2
-rw-r--r--src/backend/commands/dbcommands.c2
-rw-r--r--src/backend/commands/user.c2
-rw-r--r--src/backend/commands/vacuumparallel.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index d148d10850a..38ddae08b86 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -351,7 +351,7 @@ typedef enum
{
LISTEN_LISTEN,
LISTEN_UNLISTEN,
- LISTEN_UNLISTEN_ALL
+ LISTEN_UNLISTEN_ALL,
} ListenActionKind;
typedef struct
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c
index 0378f0ade09..c66a047c4a7 100644
--- a/src/backend/commands/copyto.c
+++ b/src/backend/commands/copyto.c
@@ -51,7 +51,7 @@ typedef enum CopyDest
{
COPY_FILE, /* to file (or a piped program) */
COPY_FRONTEND, /* to frontend */
- COPY_CALLBACK /* to callback function */
+ COPY_CALLBACK, /* to callback function */
} CopyDest;
/*
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index c52ecc61a6b..ae38f830243 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -83,7 +83,7 @@
typedef enum CreateDBStrategy
{
CREATEDB_WAL_LOG,
- CREATEDB_FILE_COPY
+ CREATEDB_FILE_COPY,
} CreateDBStrategy;
typedef struct
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index ce77a055e58..f47aa38231b 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -64,7 +64,7 @@ typedef enum
RRG_REMOVE_ADMIN_OPTION,
RRG_REMOVE_INHERIT_OPTION,
RRG_REMOVE_SET_OPTION,
- RRG_DELETE_GRANT
+ RRG_DELETE_GRANT,
} RevokeRoleGrantAction;
/* Potentially set by pg_upgrade_support functions */
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 351ab4957af..176c555d639 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -118,7 +118,7 @@ typedef enum PVIndVacStatus
PARALLEL_INDVAC_STATUS_INITIAL = 0,
PARALLEL_INDVAC_STATUS_NEED_BULKDELETE,
PARALLEL_INDVAC_STATUS_NEED_CLEANUP,
- PARALLEL_INDVAC_STATUS_COMPLETED
+ PARALLEL_INDVAC_STATUS_COMPLETED,
} PVIndVacStatus;
/*