From 3e3abbbe25cf72d9f21fef24894730bda41b5443 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 4 Jan 2024 15:16:45 +1100
Subject: [PATCH v6] GUC names - fix case datestyle

---
 src/backend/commands/variable.c        |  2 +-
 src/backend/utils/adt/datetime.c       |  2 +-
 src/test/regress/expected/date.out     | 58 +++++++++++++++++-----------------
 src/test/regress/expected/horology.out |  2 +-
 4 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 0935d85..a72db8b 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source)
 
 	if (!ok)
 	{
-		GUC_check_errdetail("Conflicting \"datestyle\" specifications.");
+		GUC_check_errdetail("Conflicting \"DateStyle\" specifications.");
 		return false;
 	}
 
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index fca9a2a..87c2c09 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra,
 					(errcode(ERRCODE_DATETIME_FIELD_OVERFLOW),
 					 errmsg("date/time field value out of range: \"%s\"",
 							str),
-					 errhint("Perhaps you need a different \"datestyle\" setting.")));
+					 errhint("Perhaps you need a different \"DateStyle\" setting.")));
 			break;
 		case DTERR_INTERVAL_OVERFLOW:
 			errsave(escontext,
diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out
index f5949f3..e936f66 100644
--- a/src/test/regress/expected/date.out
+++ b/src/test/regress/expected/date.out
@@ -94,17 +94,17 @@ SELECT date '1/8/1999';
 ERROR:  date/time field value out of range: "1/8/1999"
 LINE 1: SELECT date '1/8/1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1/18/1999';
 ERROR:  date/time field value out of range: "1/18/1999"
 LINE 1: SELECT date '1/18/1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '18/1/1999';
 ERROR:  date/time field value out of range: "18/1/1999"
 LINE 1: SELECT date '18/1/1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01/02/03';
     date    
 ------------
@@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC';
 ERROR:  date/time field value out of range: "January 8, 99 BC"
 LINE 1: SELECT date 'January 8, 99 BC';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '99-Jan-08';
     date    
 ------------
@@ -156,7 +156,7 @@ SELECT date '08-Jan-99';
 ERROR:  date/time field value out of range: "08-Jan-99"
 LINE 1: SELECT date '08-Jan-99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '08-Jan-1999';
     date    
 ------------
@@ -167,7 +167,7 @@ SELECT date 'Jan-08-99';
 ERROR:  date/time field value out of range: "Jan-08-99"
 LINE 1: SELECT date 'Jan-08-99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date 'Jan-08-1999';
     date    
 ------------
@@ -198,7 +198,7 @@ SELECT date '08 Jan 99';
 ERROR:  date/time field value out of range: "08 Jan 99"
 LINE 1: SELECT date '08 Jan 99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '08 Jan 1999';
     date    
 ------------
@@ -209,7 +209,7 @@ SELECT date 'Jan 08 99';
 ERROR:  date/time field value out of range: "Jan 08 99"
 LINE 1: SELECT date 'Jan 08 99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date 'Jan 08 1999';
     date    
 ------------
@@ -244,22 +244,22 @@ SELECT date '08-01-99';
 ERROR:  date/time field value out of range: "08-01-99"
 LINE 1: SELECT date '08-01-99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '08-01-1999';
 ERROR:  date/time field value out of range: "08-01-1999"
 LINE 1: SELECT date '08-01-1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01-08-99';
 ERROR:  date/time field value out of range: "01-08-99"
 LINE 1: SELECT date '01-08-99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01-08-1999';
 ERROR:  date/time field value out of range: "01-08-1999"
 LINE 1: SELECT date '01-08-1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '99-08-01';
     date    
 ------------
@@ -288,22 +288,22 @@ SELECT date '08 01 99';
 ERROR:  date/time field value out of range: "08 01 99"
 LINE 1: SELECT date '08 01 99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '08 01 1999';
 ERROR:  date/time field value out of range: "08 01 1999"
 LINE 1: SELECT date '08 01 1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01 08 99';
 ERROR:  date/time field value out of range: "01 08 99"
 LINE 1: SELECT date '01 08 99';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01 08 1999';
 ERROR:  date/time field value out of range: "01 08 1999"
 LINE 1: SELECT date '01 08 1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '99 08 01';
     date    
 ------------
@@ -345,7 +345,7 @@ SELECT date '1/18/1999';
 ERROR:  date/time field value out of range: "1/18/1999"
 LINE 1: SELECT date '1/18/1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '18/1/1999';
     date    
 ------------
@@ -392,7 +392,7 @@ SELECT date '99-Jan-08';
 ERROR:  date/time field value out of range: "99-Jan-08"
 LINE 1: SELECT date '99-Jan-08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-Jan-08';
     date    
 ------------
@@ -435,7 +435,7 @@ SELECT date '99 Jan 08';
 ERROR:  date/time field value out of range: "99 Jan 08"
 LINE 1: SELECT date '99 Jan 08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999 Jan 08';
     date    
 ------------
@@ -480,7 +480,7 @@ SELECT date '99-01-08';
 ERROR:  date/time field value out of range: "99-01-08"
 LINE 1: SELECT date '99-01-08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-01-08';
     date    
 ------------
@@ -515,7 +515,7 @@ SELECT date '99-08-01';
 ERROR:  date/time field value out of range: "99-08-01"
 LINE 1: SELECT date '99-08-01';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-08-01';
     date    
 ------------
@@ -526,7 +526,7 @@ SELECT date '99 01 08';
 ERROR:  date/time field value out of range: "99 01 08"
 LINE 1: SELECT date '99 01 08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999 01 08';
     date    
 ------------
@@ -561,7 +561,7 @@ SELECT date '99 08 01';
 ERROR:  date/time field value out of range: "99 08 01"
 LINE 1: SELECT date '99 08 01';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999 08 01';
     date    
 ------------
@@ -603,7 +603,7 @@ SELECT date '18/1/1999';
 ERROR:  date/time field value out of range: "18/1/1999"
 LINE 1: SELECT date '18/1/1999';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '01/02/03';
     date    
 ------------
@@ -644,7 +644,7 @@ SELECT date '99-Jan-08';
 ERROR:  date/time field value out of range: "99-Jan-08"
 LINE 1: SELECT date '99-Jan-08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-Jan-08';
     date    
 ------------
@@ -731,7 +731,7 @@ SELECT date '99-01-08';
 ERROR:  date/time field value out of range: "99-01-08"
 LINE 1: SELECT date '99-01-08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-01-08';
     date    
 ------------
@@ -766,7 +766,7 @@ SELECT date '99-08-01';
 ERROR:  date/time field value out of range: "99-08-01"
 LINE 1: SELECT date '99-08-01';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999-08-01';
     date    
 ------------
@@ -777,7 +777,7 @@ SELECT date '99 01 08';
 ERROR:  date/time field value out of range: "99 01 08"
 LINE 1: SELECT date '99 01 08';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999 01 08';
     date    
 ------------
@@ -812,7 +812,7 @@ SELECT date '99 08 01';
 ERROR:  date/time field value out of range: "99 08 01"
 LINE 1: SELECT date '99 08 01';
                     ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 SELECT date '1999 08 01';
     date    
 ------------
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index cfb4b20..821d160 100644
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
 ERROR:  date/time field value out of range: "27/12/2001 04:05:06.789-08"
 LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'...
                                         ^
-HINT:  Perhaps you need a different "datestyle" setting.
+HINT:  Perhaps you need a different "DateStyle" setting.
 set datestyle to dmy;
 SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
            timestamptz            
-- 
1.8.3.1

