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

Commit7be1b3b

Browse files
committed
Add hint for to_char(interval) invalid format specifications.
1 parenta11fe54 commit7be1b3b

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.98 2005/08/1804:37:08 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.99 2005/08/1813:43:08 momjian Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2005, PostgreSQL Global Development Group
@@ -421,26 +421,27 @@ typedef struct TmToChar
421421
#definetmtcFsec(_X)((_X)->fsec)
422422

423423
#defineZERO_tm(_X) \
424-
do {\
425-
(_X)->tm_sec = (_X)->tm_year = (_X)->tm_min = (_X)->tm_wday = \
426-
(_X)->tm_hour = (_X)->tm_yday = (_X)->tm_isdst = 0; \
427-
(_X)->tm_mday = (_X)->tm_mon = 1; \
428-
} while(0)
424+
do {\
425+
(_X)->tm_sec = (_X)->tm_year = (_X)->tm_min = (_X)->tm_wday = \
426+
(_X)->tm_hour = (_X)->tm_yday = (_X)->tm_isdst = 0; \
427+
(_X)->tm_mday = (_X)->tm_mon = 1; \
428+
} while(0)
429429

430430
#defineZERO_tmtc(_X) \
431-
do { \
432-
ZERO_tm( tmtcTm(_X) ); \
433-
tmtcFsec(_X) = 0; \
434-
tmtcTzn(_X) = NULL; \
435-
} while(0)
431+
do { \
432+
ZERO_tm( tmtcTm(_X) ); \
433+
tmtcFsec(_X) = 0; \
434+
tmtcTzn(_X) = NULL; \
435+
} while(0)
436436

437437
#defineINVALID_FOR_INTERVAL \
438-
do { \
439-
if (is_interval) \
440-
ereport(ERROR, \
441-
(errcode(ERRCODE_INVALID_DATETIME_FORMAT), \
442-
errmsg("invalid format specification for an interval value"))); \
443-
} while(0)
438+
do { \
439+
if (is_interval) \
440+
ereport(ERROR, \
441+
(errcode(ERRCODE_INVALID_DATETIME_FORMAT), \
442+
errmsg("invalid format specification for an interval value"), \
443+
errhint("Intervals are not tied to specific calendar dates."))); \
444+
} while(0)
444445

445446
/*****************************************************************************
446447
*KeyWords definition & action

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp