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

Commit 531e60a

Browse files
committed
Remove unused tzn arguments for timestamp2tm()
1 parent 7c8cfed commit 531e60a

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

src/backend/utils/adt/date.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -969,15 +969,14 @@ timestamptz_date(PG_FUNCTION_ARGS)
969969
*tm = &tt;
970970
fsec_t fsec;
971971
int tz;
972-
char *tzn;
973972

974973
if (TIMESTAMP_IS_NOBEGIN(timestamp))
975974
DATE_NOBEGIN(result);
976975
else if (TIMESTAMP_IS_NOEND(timestamp))
977976
DATE_NOEND(result);
978977
else
979978
{
980-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
979+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
981980
ereport(ERROR,
982981
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
983982
errmsg("timestamp out of range")));
@@ -1576,12 +1575,11 @@ timestamptz_time(PG_FUNCTION_ARGS)
15761575
*tm = &tt;
15771576
int tz;
15781577
fsec_t fsec;
1579-
char *tzn;
15801578

15811579
if (TIMESTAMP_NOT_FINITE(timestamp))
15821580
PG_RETURN_NULL();
15831581

1584-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
1582+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
15851583
ereport(ERROR,
15861584
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
15871585
errmsg("timestamp out of range")));
@@ -2450,12 +2448,11 @@ timestamptz_timetz(PG_FUNCTION_ARGS)
24502448
*tm = &tt;
24512449
int tz;
24522450
fsec_t fsec;
2453-
char *tzn;
24542451

24552452
if (TIMESTAMP_NOT_FINITE(timestamp))
24562453
PG_RETURN_NULL();
24572454

2458-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
2455+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
24592456
ereport(ERROR,
24602457
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
24612458
errmsg("timestamp out of range")));

src/backend/utils/adt/timestamp.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ timestamptz_recv(PG_FUNCTION_ARGS)
530530
struct pg_tm tt,
531531
*tm = &tt;
532532
fsec_t fsec;
533-
char *tzn;
534533

535534
#ifdef HAVE_INT64_TIMESTAMP
536535
timestamp = (TimestampTz) pq_getmsgint64(buf);
@@ -541,7 +540,7 @@ timestamptz_recv(PG_FUNCTION_ARGS)
541540
/* rangecheck: see if timestamptz_out would like it */
542541
if (TIMESTAMP_NOT_FINITE(timestamp))
543542
/* ok */ ;
544-
else if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
543+
else if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
545544
ereport(ERROR,
546545
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
547546
errmsg("timestamp out of range")));
@@ -2723,7 +2722,6 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
27232722
Interval *span = PG_GETARG_INTERVAL_P(1);
27242723
TimestampTz result;
27252724
int tz;
2726-
char *tzn;
27272725

27282726
if (TIMESTAMP_NOT_FINITE(timestamp))
27292727
result = timestamp;
@@ -2735,7 +2733,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
27352733
*tm = &tt;
27362734
fsec_t fsec;
27372735

2738-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
2736+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
27392737
ereport(ERROR,
27402738
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
27412739
errmsg("timestamp out of range")));
@@ -2771,7 +2769,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
27712769
fsec_t fsec;
27722770
int julian;
27732771

2774-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
2772+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
27752773
ereport(ERROR,
27762774
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
27772775
errmsg("timestamp out of range")));
@@ -3250,12 +3248,11 @@ timestamptz_age(PG_FUNCTION_ARGS)
32503248
*tm2 = &tt2;
32513249
int tz1;
32523250
int tz2;
3253-
char *tzn;
32543251

32553252
result = (Interval *) palloc(sizeof(Interval));
32563253

3257-
if (timestamp2tm(dt1, &tz1, tm1, &fsec1, &tzn, NULL) == 0 &&
3258-
timestamp2tm(dt2, &tz2, tm2, &fsec2, &tzn, NULL) == 0)
3254+
if (timestamp2tm(dt1, &tz1, tm1, &fsec1, NULL, NULL) == 0 &&
3255+
timestamp2tm(dt2, &tz2, tm2, &fsec2, NULL, NULL) == 0)
32593256
{
32603257
/* form the symbolic difference */
32613258
fsec = fsec1 - fsec2;
@@ -3509,7 +3506,6 @@ timestamptz_trunc(PG_FUNCTION_ARGS)
35093506
bool redotz = false;
35103507
char *lowunits;
35113508
fsec_t fsec;
3512-
char *tzn;
35133509
struct pg_tm tt,
35143510
*tm = &tt;
35153511

@@ -3524,7 +3520,7 @@ timestamptz_trunc(PG_FUNCTION_ARGS)
35243520

35253521
if (type == UNITS)
35263522
{
3527-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
3523+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
35283524
ereport(ERROR,
35293525
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
35303526
errmsg("timestamp out of range")));
@@ -4159,7 +4155,6 @@ timestamptz_part(PG_FUNCTION_ARGS)
41594155
char *lowunits;
41604156
double dummy;
41614157
fsec_t fsec;
4162-
char *tzn;
41634158
struct pg_tm tt,
41644159
*tm = &tt;
41654160

@@ -4179,7 +4174,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
41794174

41804175
if (type == UNITS)
41814176
{
4182-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
4177+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
41834178
ereport(ERROR,
41844179
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
41854180
errmsg("timestamp out of range")));
@@ -4319,7 +4314,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
43194314

43204315
case DTK_DOW:
43214316
case DTK_ISODOW:
4322-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
4317+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
43234318
ereport(ERROR,
43244319
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
43254320
errmsg("timestamp out of range")));
@@ -4329,7 +4324,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
43294324
break;
43304325

43314326
case DTK_DOY:
4332-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
4327+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
43334328
ereport(ERROR,
43344329
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
43354330
errmsg("timestamp out of range")));
@@ -4650,14 +4645,13 @@ timestamptz_timestamp(PG_FUNCTION_ARGS)
46504645
struct pg_tm tt,
46514646
*tm = &tt;
46524647
fsec_t fsec;
4653-
char *tzn;
46544648
int tz;
46554649

46564650
if (TIMESTAMP_NOT_FINITE(timestamp))
46574651
result = timestamp;
46584652
else
46594653
{
4660-
if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn, NULL) != 0)
4654+
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
46614655
ereport(ERROR,
46624656
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
46634657
errmsg("timestamp out of range")));

0 commit comments

Comments
 (0)