DCH_MS,
DCH_Month,
DCH_Mon,
+ DCH_OF,
DCH_P_M,
DCH_PM,
DCH_Q,
{"MS", 2, DCH_MS, TRUE, FROM_CHAR_DATE_NONE},
{"Month", 5, DCH_Month, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"Mon", 3, DCH_Mon, FALSE, FROM_CHAR_DATE_GREGORIAN},
+ {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */
{"P.M.", 4, DCH_P_M, FALSE, FROM_CHAR_DATE_NONE}, /* P */
{"PM", 2, DCH_PM, FALSE, FROM_CHAR_DATE_NONE},
{"Q", 1, DCH_Q, TRUE, FROM_CHAR_DATE_NONE}, /* Q */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, DCH_A_D, DCH_B_C, DCH_CC, DCH_DAY, -1,
- DCH_FX, -1, DCH_HH24, DCH_IDDD, DCH_J, -1, -1, DCH_MI, -1, -1,
+ DCH_FX, -1, DCH_HH24, DCH_IDDD, DCH_J, -1, -1, DCH_MI, -1, DCH_OF,
DCH_P_M, DCH_Q, DCH_RM, DCH_SSSS, DCH_TZ, DCH_US, -1, DCH_WW, -1, DCH_Y_YYY,
-1, -1, -1, -1, -1, -1, -1, DCH_a_d, DCH_b_c, DCH_cc,
DCH_day, -1, DCH_fx, -1, DCH_hh24, DCH_iddd, DCH_j, -1, -1, DCH_mi,
s += strlen(s);
}
break;
+ case DCH_OF:
+ INVALID_FOR_INTERVAL;
+ sprintf(s, "%+0*ld", S_FM(n->suffix) ? 0 : 3, tm->tm_gmtoff / SECS_PER_HOUR);
+ s += strlen(s);
+ if (tm->tm_gmtoff % SECS_PER_HOUR != 0)
+ {
+ sprintf(s, ":%02ld", (tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
+ s += strlen(s);
+ }
+ break;
case DCH_A_D:
case DCH_B_C:
INVALID_FOR_INTERVAL;
break;
case DCH_tz:
case DCH_TZ:
+ case DCH_OF:
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("\"TZ\"/\"tz\" format patterns are not supported in to_date")));
+ errmsg("\"TZ\"/\"tz\"/\"OF\" format patterns are not supported in to_date")));
case DCH_A_D:
case DCH_B_C:
case DCH_a_d: