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

Commit91e7c90

Browse files
committed
Fix internal extract(timezone_minute) formulas
Through various refactorings over time, the extract(timezone_minutefrom time with time zone) and extract(timezone_minute from timestampwith time zone) implementations ended up with two different butequally nonsensical formulas by using SECS_PER_MINUTE andMINS_PER_HOUR interchangeably. Since those two are of course both thesame number, the formulas do work, but for readability, fix them to besemantically correct.
1 parentdde1a35 commit91e7c90

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2726,7 +2726,7 @@ timetz_part(PG_FUNCTION_ARGS)
27262726
caseDTK_TZ_MINUTE:
27272727
result=-tz;
27282728
result /=SECS_PER_MINUTE;
2729-
FMODULO(result,dummy, (double)SECS_PER_MINUTE);
2729+
FMODULO(result,dummy, (double)MINS_PER_HOUR);
27302730
break;
27312731

27322732
caseDTK_TZ_HOUR:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,7 +4844,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
48444844

48454845
caseDTK_TZ_MINUTE:
48464846
result=-tz;
4847-
result /=MINS_PER_HOUR;
4847+
result /=SECS_PER_MINUTE;
48484848
FMODULO(result,dummy, (double)MINS_PER_HOUR);
48494849
break;
48504850

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp