postgresql/src
Tom Lane 6be39d77a7 Fix extraction of week and quarter fields from intervals.
"EXTRACT(WEEK FROM interval_value)" formerly threw an error.
Define it as "tm->tm_mday / 7".  (With C99 division semantics,
this gives consistent results for negative intervals.)

"EXTRACT(QUARTER FROM interval_value)" has been implemented
all along, but it formerly gave extremely strange results for
negative intervals.  Fix it so that the output for -N months
is the negative of the output for N months.

Per bug #18348 from Michael Bondarenko and subsequent discussion.

Discussion: https://postgr.es/m/18348-b097a3587dfde8a4@postgresql.org
2024-08-16 12:35:53 -04:00
..
backend Fix extraction of week and quarter fields from intervals. 2024-08-16 12:35:53 -04:00
bin All POSIX systems have langinfo.h and CODESET. 2024-08-13 22:13:52 +12:00
common Remove fe_memutils from libpgcommon_shlib 2024-08-12 08:30:39 +02:00
fe_utils Improve file header comments for astramer code. 2024-08-07 08:49:41 -04:00
include Remove dependence on -fwrapv semantics in a few places. 2024-08-15 15:47:31 -05:00
interfaces libpq: Fix minor TOCTOU violation 2024-08-16 06:41:17 +02:00
makefiles Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
pl Fix edge case in plpgsql's make_callstmt_target(). 2024-08-07 12:54:39 -04:00
port Harmonize MinGW CODESET lookup with MSVC. 2024-08-14 15:04:14 +12:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Fix extraction of week and quarter fields from intervals. 2024-08-16 12:35:53 -04:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Rename bbstreamer to astreamer. 2024-08-05 09:56:25 -04:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00