1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

Cause SHOW DATESTYLE to produce a string that will be accepted by SET

DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
This commit is contained in:
Tom Lane
2003-07-15 19:19:56 +00:00
parent 274328c8a8
commit cfa6999d3b
10 changed files with 65 additions and 95 deletions

View File

@@ -2385,9 +2385,9 @@ DROP TABLE TEMP_TIMESTAMP;
--
SET DateStyle TO 'US,Postgres';
SHOW DateStyle;
DateStyle
--------------------------------------------
Postgres with US (NonEuropean) conventions
DateStyle
--------------
Postgres, US
(1 row)
SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
@@ -2555,9 +2555,9 @@ SELECT '' AS seven, f1 AS us_iso FROM ABSTIME_TBL;
SET DateStyle TO 'US,SQL';
SHOW DateStyle;
DateStyle
---------------------------------------
SQL with US (NonEuropean) conventions
DateStyle
-----------
SQL, US
(1 row)
SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
@@ -2643,9 +2643,9 @@ SELECT '' AS seven, f1 AS us_sql FROM ABSTIME_TBL;
SET DateStyle TO 'European,Postgres';
SHOW DateStyle;
DateStyle
------------------------------------
Postgres with European conventions
DateStyle
--------------------
Postgres, European
(1 row)
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
@@ -2739,9 +2739,9 @@ SELECT '' AS seven, f1 AS european_postgres FROM ABSTIME_TBL;
SET DateStyle TO 'European,ISO';
SHOW DateStyle;
DateStyle
-------------------------------
ISO with European conventions
DateStyle
---------------
ISO, European
(1 row)
SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
@@ -2828,9 +2828,9 @@ SELECT '' AS seven, f1 AS european_iso FROM ABSTIME_TBL;
SET DateStyle TO 'European,SQL';
SHOW DateStyle;
DateStyle
-------------------------------
SQL with European conventions
DateStyle
---------------
SQL, European
(1 row)
SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;

View File

@@ -2385,9 +2385,9 @@ DROP TABLE TEMP_TIMESTAMP;
--
SET DateStyle TO 'US,Postgres';
SHOW DateStyle;
DateStyle
--------------------------------------------
Postgres with US (NonEuropean) conventions
DateStyle
--------------
Postgres, US
(1 row)
SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
@@ -2555,9 +2555,9 @@ SELECT '' AS seven, f1 AS us_iso FROM ABSTIME_TBL;
SET DateStyle TO 'US,SQL';
SHOW DateStyle;
DateStyle
---------------------------------------
SQL with US (NonEuropean) conventions
DateStyle
-----------
SQL, US
(1 row)
SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
@@ -2643,9 +2643,9 @@ SELECT '' AS seven, f1 AS us_sql FROM ABSTIME_TBL;
SET DateStyle TO 'European,Postgres';
SHOW DateStyle;
DateStyle
------------------------------------
Postgres with European conventions
DateStyle
--------------------
Postgres, European
(1 row)
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
@@ -2739,9 +2739,9 @@ SELECT '' AS seven, f1 AS european_postgres FROM ABSTIME_TBL;
SET DateStyle TO 'European,ISO';
SHOW DateStyle;
DateStyle
-------------------------------
ISO with European conventions
DateStyle
---------------
ISO, European
(1 row)
SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
@@ -2828,9 +2828,9 @@ SELECT '' AS seven, f1 AS european_iso FROM ABSTIME_TBL;
SET DateStyle TO 'European,SQL';
SHOW DateStyle;
DateStyle
-------------------------------
SQL with European conventions
DateStyle
---------------
SQL, European
(1 row)
SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;

View File

@@ -2385,9 +2385,9 @@ DROP TABLE TEMP_TIMESTAMP;
--
SET DateStyle TO 'US,Postgres';
SHOW DateStyle;
DateStyle
--------------------------------------------
Postgres with US (NonEuropean) conventions
DateStyle
--------------
Postgres, US
(1 row)
SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
@@ -2555,9 +2555,9 @@ SELECT '' AS seven, f1 AS us_iso FROM ABSTIME_TBL;
SET DateStyle TO 'US,SQL';
SHOW DateStyle;
DateStyle
---------------------------------------
SQL with US (NonEuropean) conventions
DateStyle
-----------
SQL, US
(1 row)
SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
@@ -2643,9 +2643,9 @@ SELECT '' AS seven, f1 AS us_sql FROM ABSTIME_TBL;
SET DateStyle TO 'European,Postgres';
SHOW DateStyle;
DateStyle
------------------------------------
Postgres with European conventions
DateStyle
--------------------
Postgres, European
(1 row)
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
@@ -2739,9 +2739,9 @@ SELECT '' AS seven, f1 AS european_postgres FROM ABSTIME_TBL;
SET DateStyle TO 'European,ISO';
SHOW DateStyle;
DateStyle
-------------------------------
ISO with European conventions
DateStyle
---------------
ISO, European
(1 row)
SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
@@ -2828,9 +2828,9 @@ SELECT '' AS seven, f1 AS european_iso FROM ABSTIME_TBL;
SET DateStyle TO 'European,SQL';
SHOW DateStyle;
DateStyle
-------------------------------
SQL with European conventions
DateStyle
---------------
SQL, European
(1 row)
SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;