summaryrefslogtreecommitdiff
path: root/src/backend/parser
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/parser
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/parser')
-rw-r--r--src/backend/parser/parse_collate.c2
-rw-r--r--src/backend/parser/parse_cte.c2
-rw-r--r--src/backend/parser/parse_func.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/parser/parse_collate.c b/src/backend/parser/parse_collate.c
index 9f6afc351ce..c480ce36825 100644
--- a/src/backend/parser/parse_collate.c
+++ b/src/backend/parser/parse_collate.c
@@ -58,7 +58,7 @@ typedef enum
COLLATE_NONE, /* expression is of a noncollatable datatype */
COLLATE_IMPLICIT, /* collation was derived implicitly */
COLLATE_CONFLICT, /* we had a conflict of implicit collations */
- COLLATE_EXPLICIT /* collation was derived explicitly */
+ COLLATE_EXPLICIT, /* collation was derived explicitly */
} CollateStrength;
typedef struct
diff --git a/src/backend/parser/parse_cte.c b/src/backend/parser/parse_cte.c
index c5b1a49725c..6992a788c0b 100644
--- a/src/backend/parser/parse_cte.c
+++ b/src/backend/parser/parse_cte.c
@@ -35,7 +35,7 @@ typedef enum
RECURSION_SUBLINK, /* inside a sublink */
RECURSION_OUTERJOIN, /* inside nullable side of an outer join */
RECURSION_INTERSECT, /* underneath INTERSECT (ALL) */
- RECURSION_EXCEPT /* underneath EXCEPT (ALL) */
+ RECURSION_EXCEPT, /* underneath EXCEPT (ALL) */
} RecursionContext;
/* Associated error messages --- each must have one %s for CTE name */
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index b3f0b6a137a..6c29471bb33 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -39,7 +39,7 @@
typedef enum
{
FUNCLOOKUP_NOSUCHFUNC,
- FUNCLOOKUP_AMBIGUOUS
+ FUNCLOOKUP_AMBIGUOUS,
} FuncLookupError;
static void unify_hypothetical_args(ParseState *pstate,