mirror of https://github.com/postgres/postgres.git
Add 'GERMAN' option to DateStyle.
parent
0569136e48
commit
0295864514
|
|
@ -2,7 +2,7 @@
|
||||||
* Routines for handling of 'SET var TO',
|
* Routines for handling of 'SET var TO',
|
||||||
* 'SHOW var' and 'RESET var' statements.
|
* 'SHOW var' and 'RESET var' statements.
|
||||||
*
|
*
|
||||||
* $Id: variable.c,v 1.23 1997/11/21 18:11:20 momjian Exp $
|
* $Id: variable.c,v 1.24 1997/12/04 23:17:13 thomas Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -351,33 +351,40 @@ parse_date(const char *value)
|
||||||
{
|
{
|
||||||
/* Ugh. Somebody ought to write a table driven version -- mjl */
|
/* Ugh. Somebody ought to write a table driven version -- mjl */
|
||||||
|
|
||||||
if (!strcasecmp(tok, "iso"))
|
if (!strcasecmp(tok, "ISO"))
|
||||||
{
|
{
|
||||||
DateStyle = USE_ISO_DATES;
|
DateStyle = USE_ISO_DATES;
|
||||||
dcnt++;
|
dcnt++;
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(tok, "sql"))
|
else if (!strcasecmp(tok, "SQL"))
|
||||||
{
|
{
|
||||||
DateStyle = USE_SQL_DATES;
|
DateStyle = USE_SQL_DATES;
|
||||||
dcnt++;
|
dcnt++;
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(tok, "postgres"))
|
else if (!strcasecmp(tok, "POSTGRES"))
|
||||||
{
|
{
|
||||||
DateStyle = USE_POSTGRES_DATES;
|
DateStyle = USE_POSTGRES_DATES;
|
||||||
dcnt++;
|
dcnt++;
|
||||||
}
|
}
|
||||||
else if (!strncasecmp(tok, "euro", 4))
|
else if (!strcasecmp(tok, "GERMAN"))
|
||||||
|
{
|
||||||
|
DateStyle = USE_GERMAN_DATES;
|
||||||
|
dcnt++;
|
||||||
|
EuroDates = TRUE;
|
||||||
|
if ((ecnt > 0) && (! EuroDates)) ecnt++;
|
||||||
|
}
|
||||||
|
else if (!strncasecmp(tok, "EURO", 4))
|
||||||
{
|
{
|
||||||
EuroDates = TRUE;
|
EuroDates = TRUE;
|
||||||
ecnt++;
|
if ((dcnt <= 0) || (DateStyle != USE_GERMAN_DATES)) ecnt++;
|
||||||
}
|
}
|
||||||
else if ((!strcasecmp(tok, "us"))
|
else if ((!strcasecmp(tok, "US"))
|
||||||
|| (!strncasecmp(tok, "noneuro", 7)))
|
|| (!strncasecmp(tok, "NONEURO", 7)))
|
||||||
{
|
{
|
||||||
EuroDates = FALSE;
|
EuroDates = FALSE;
|
||||||
ecnt++;
|
if ((dcnt <= 0) || (DateStyle == USE_GERMAN_DATES)) ecnt++;
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(tok, "default"))
|
else if (!strcasecmp(tok, "DEFAULT"))
|
||||||
{
|
{
|
||||||
DateStyle = USE_POSTGRES_DATES;
|
DateStyle = USE_POSTGRES_DATES;
|
||||||
EuroDates = FALSE;
|
EuroDates = FALSE;
|
||||||
|
|
@ -410,6 +417,9 @@ show_date()
|
||||||
case USE_SQL_DATES:
|
case USE_SQL_DATES:
|
||||||
strcat(buf, "SQL");
|
strcat(buf, "SQL");
|
||||||
break;
|
break;
|
||||||
|
case USE_GERMAN_DATES:
|
||||||
|
strcat(buf, "German");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
strcat(buf, "Postgres");
|
strcat(buf, "Postgres");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue