Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
F.12. daterange_inclusive — upper bound-inclusivedaterange
Prev UpAppendix F. Additional Supplied Modules and Extensions Shipped inpostgrespro-std-17-contribHome Next

F.12. daterange_inclusive — upper bound-inclusivedaterange#

daterange_inclusive is an extension to the built-indaterange range type. By default,daterange excludes the upper bound of the range —[), whereasdaterange_inclusive does not —[]. Other than the covered range bound, there are no other differences betweendaterange anddaterange_inclusive.

This module is consideredtrusted, that is, it can be installed by non-superusers who haveCREATE privilege on the current database.

F.12.1. Rationale#

At times, it is more convenient to output date ranges with inclusive upper bounds. For example, it may apply to employees' absences. If an employee is absent from January 1, 2025, to January 10, 2025, using thedaterange range type will prevent the database from outputting this date range in its entirety. In such cases, you would need to manually subtract one day from the output. Thedaterange_inclusive extension addresses this issue.

F.12.2. Example Usage#

   CREATE EXTENSION daterange_inclusive;   SELECT daterange('[2024-01-01,2024-06-01]');         daterange   -------------------------   [2024-01-01,2024-06-02)   SELECT daterange_inclusive('[2024-01-01,2024-06-01]');      daterange_inclusive   -------------------------   [2024-01-01,2024-06-01]

Prev Up Next
F.11. cube — a multi-dimensional cube data type Home F.13. dbcopies_decoding — 1C module for updating database copies
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp