Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0295864

Browse files
author
Thomas G. Lockhart
committed
Add 'GERMAN' option to DateStyle.
1 parent0569136 commit0295864

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

‎src/backend/tcop/variable.c

Lines changed: 20 additions & 10 deletions
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-
elseif (!strcasecmp(tok,"sql"))
359+
elseif (!strcasecmp(tok,"SQL"))
360360
{
361361
DateStyle=USE_SQL_DATES;
362362
dcnt++;
363363
}
364-
elseif (!strcasecmp(tok,"postgres"))
364+
elseif (!strcasecmp(tok,"POSTGRES"))
365365
{
366366
DateStyle=USE_POSTGRES_DATES;
367367
dcnt++;
368368
}
369-
elseif (!strncasecmp(tok,"euro",4))
369+
elseif (!strcasecmp(tok,"GERMAN"))
370370
{
371+
DateStyle=USE_GERMAN_DATES;
372+
dcnt++;
371373
EuroDates= TRUE;
372-
ecnt++;
374+
if ((ecnt>0)&& (!EuroDates))ecnt++;
373375
}
374-
elseif ((!strcasecmp(tok,"us"))
375-
|| (!strncasecmp(tok,"noneuro",7)))
376+
elseif (!strncasecmp(tok,"EURO",4))
377+
{
378+
EuroDates= TRUE;
379+
if ((dcnt <=0)|| (DateStyle!=USE_GERMAN_DATES))ecnt++;
380+
}
381+
elseif ((!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-
elseif (!strcasecmp(tok,"default"))
387+
elseif (!strcasecmp(tok,"DEFAULT"))
381388
{
382389
DateStyle=USE_POSTGRES_DATES;
383390
EuroDates= FALSE;
@@ -410,6 +417,9 @@ show_date()
410417
caseUSE_SQL_DATES:
411418
strcat(buf,"SQL");
412419
break;
420+
caseUSE_GERMAN_DATES:
421+
strcat(buf,"German");
422+
break;
413423
default:
414424
strcat(buf,"Postgres");
415425
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp