From 505260eae8086b6babbdee9b4eafc95f728bd1cd Mon Sep 17 00:00:00 2001
From: Nikita Glukhov <n.gluhov@postgrespro.ru>
Date: Sat, 1 Apr 2023 16:19:51 +0300
Subject: [PATCH v6 02/11] Add GUC compat_field_notation

---
 src/backend/parser/parse_expr.c     |  1 +
 src/backend/utils/misc/guc_tables.c | 11 +++++++++++
 src/include/parser/parse_expr.h     |  1 +
 3 files changed, 13 insertions(+)

diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 7d57bde8134..1c8c4149798 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -42,6 +42,7 @@
 
 /* GUC parameters */
 bool		Transform_null_equals = false;
+bool		compat_field_notation = false;
 
 
 static Node *transformExprRecurse(ParseState *pstate, Node *expr);
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index 8a67f01200c..06294eda1f6 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -2076,6 +2076,17 @@ struct config_bool ConfigureNamesBool[] =
 		NULL, NULL, NULL
 	},
 
+	{
+		{"compat_field_notation", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+			gettext_noop("Give a preference to function field notation over generic type subscripting."),
+			NULL,
+			GUC_EXPLAIN
+		},
+		&compat_field_notation,
+		false,
+		NULL, NULL, NULL
+	},
+
 	/* End-of-list marker */
 	{
 		{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL
diff --git a/src/include/parser/parse_expr.h b/src/include/parser/parse_expr.h
index 9b46dfd9ecc..f1f479fa56b 100644
--- a/src/include/parser/parse_expr.h
+++ b/src/include/parser/parse_expr.h
@@ -17,6 +17,7 @@
 
 /* GUC parameters */
 extern PGDLLIMPORT bool Transform_null_equals;
+extern PGDLLIMPORT bool compat_field_notation;
 
 extern Node *transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind);
 
-- 
2.25.1

