Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0295864

Browse files
author
Thomas G. Lockhart
committed
Add 'GERMAN' option to DateStyle.
1 parent 0569136 commit 0295864

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/backend/tcop/variable.c

+20-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines for handling of 'SET var TO',
33
* 'SHOW var' and 'RESET var' statements.
44
*
5-
* $Id: variable.c,v 1.23 1997/11/21 18:11:20 momjian Exp $
5+
* $Id: variable.c,v 1.24 1997/12/04 23:17:13 thomas Exp $
66
*
77
*/
88

@@ -351,33 +351,40 @@ parse_date(const char *value)
351351
{
352352
/* Ugh. Somebody ought to write a table driven version -- mjl */
353353

354-
if (!strcasecmp(tok, "iso"))
354+
if (!strcasecmp(tok, "ISO"))
355355
{
356356
DateStyle = USE_ISO_DATES;
357357
dcnt++;
358358
}
359-
else if (!strcasecmp(tok, "sql"))
359+
else if (!strcasecmp(tok, "SQL"))
360360
{
361361
DateStyle = USE_SQL_DATES;
362362
dcnt++;
363363
}
364-
else if (!strcasecmp(tok, "postgres"))
364+
else if (!strcasecmp(tok, "POSTGRES"))
365365
{
366366
DateStyle = USE_POSTGRES_DATES;
367367
dcnt++;
368368
}
369-
else if (!strncasecmp(tok, "euro", 4))
369+
else if (!strcasecmp(tok, "GERMAN"))
370370
{
371+
DateStyle = USE_GERMAN_DATES;
372+
dcnt++;
371373
EuroDates = TRUE;
372-
ecnt++;
374+
if ((ecnt > 0) && (! EuroDates)) ecnt++;
373375
}
374-
else if ((!strcasecmp(tok, "us"))
375-
|| (!strncasecmp(tok, "noneuro", 7)))
376+
else if (!strncasecmp(tok, "EURO", 4))
377+
{
378+
EuroDates = TRUE;
379+
if ((dcnt <= 0) || (DateStyle != USE_GERMAN_DATES)) ecnt++;
380+
}
381+
else if ((!strcasecmp(tok, "US"))
382+
|| (!strncasecmp(tok, "NONEURO", 7)))
376383
{
377384
EuroDates = FALSE;
378-
ecnt++;
385+
if ((dcnt <= 0) || (DateStyle == USE_GERMAN_DATES)) ecnt++;
379386
}
380-
else if (!strcasecmp(tok, "default"))
387+
else if (!strcasecmp(tok, "DEFAULT"))
381388
{
382389
DateStyle = USE_POSTGRES_DATES;
383390
EuroDates = FALSE;
@@ -410,6 +417,9 @@ show_date()
410417
case USE_SQL_DATES:
411418
strcat(buf, "SQL");
412419
break;
420+
case USE_GERMAN_DATES:
421+
strcat(buf, "German");
422+
break;
413423
default:
414424
strcat(buf, "Postgres");
415425
break;

0 commit comments

Comments
 (0)