MobilityDB  1.0
timeops.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * MobilityDB includes portions of PostGIS version 3 source code released
9  * under the GNU General Public License (GPLv2 or later).
10  * Copyright (c) 2001-2021, PostGIS contributors
11  *
12  * Permission to use, copy, modify, and distribute this software and its
13  * documentation for any purpose, without fee, and without a written
14  * agreement is hereby granted, provided that the above copyright notice and
15  * this paragraph and the following two paragraphs appear in all copies.
16  *
17  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
18  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
19  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
20  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
21  * OF SUCH DAMAGE.
22  *
23  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
26  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
27  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
28  *
29  *****************************************************************************/
30 
36 #ifndef __TIMEOPS_H__
37 #define __TIMEOPS_H__
38 
39 #include <postgres.h>
40 #include <catalog/pg_type.h>
41 #include "timetypes.h"
42 
43 /*****************************************************************************/
44 
48 typedef enum
49 {
54 
55 /* Miscellaneous */
56 
57 extern void ensure_time_type_oid(Oid timetypid);
58 
59 /* Functions for aggregations */
60 
61 extern RelativeTimePos pos_timestamp_timestamp(TimestampTz t1, TimestampTz t2);
62 extern RelativeTimePos pos_period_timestamp(const Period *p, TimestampTz t);
63 
64 /* contains? */
65 
66 extern Datum contains_timestampset_timestamp(PG_FUNCTION_ARGS);
67 extern Datum contains_timestampset_timestampset(PG_FUNCTION_ARGS);
68 extern Datum contains_period_timestamp(PG_FUNCTION_ARGS);
69 extern Datum contains_period_timestampset(PG_FUNCTION_ARGS);
70 extern Datum contains_period_period(PG_FUNCTION_ARGS);
71 extern Datum contains_periodset_timestamp(PG_FUNCTION_ARGS);
72 extern Datum contains_periodset_timestampset(PG_FUNCTION_ARGS);
73 extern Datum contains_periodset_period(PG_FUNCTION_ARGS);
74 extern Datum contains_period_periodset(PG_FUNCTION_ARGS);
75 extern Datum contains_periodset_periodset(PG_FUNCTION_ARGS);
76 
77 extern bool contains_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
79 extern bool contains_period_timestamp_internal(const Period *p, TimestampTz t);
80 extern bool contains_period_timestampset_internal(const Period *p, const TimestampSet *ts);
81 extern bool contains_period_period_internal(const Period *p1, const Period *p2);
82 extern bool contains_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
83 extern bool contains_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
84 extern bool contains_periodset_period_internal(const PeriodSet *ps, const Period *p);
85 extern bool contains_period_periodset_internal(const Period *p, const PeriodSet *ps);
86 extern bool contains_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
87 
88 /* contained? */
89 
90 extern Datum contained_timestamp_timestampset(PG_FUNCTION_ARGS);
91 extern Datum contained_timestamp_period(PG_FUNCTION_ARGS);
92 extern Datum contained_timestamp_periodset(PG_FUNCTION_ARGS);
93 extern Datum contained_timestampset_timestampset(PG_FUNCTION_ARGS);
94 extern Datum contained_timestampset_period(PG_FUNCTION_ARGS);
95 extern Datum contained_timestampset_periodset(PG_FUNCTION_ARGS);
96 extern Datum contained_period_period(PG_FUNCTION_ARGS);
97 extern Datum contained_period_periodset(PG_FUNCTION_ARGS);
98 extern Datum contained_periodset_period(PG_FUNCTION_ARGS);
99 extern Datum contained_periodset_periodset(PG_FUNCTION_ARGS);
100 
101 extern bool contained_period_period_internal(const Period *p1, const Period *p2);
102 
103 /* overlaps? */
104 
105 extern Datum overlaps_timestampset_timestampset(PG_FUNCTION_ARGS);
106 extern Datum overlaps_period_timestampset(PG_FUNCTION_ARGS);
107 extern Datum overlaps_period_period(PG_FUNCTION_ARGS);
108 extern Datum overlaps_periodset_timestampset(PG_FUNCTION_ARGS);
109 extern Datum overlaps_periodset_period(PG_FUNCTION_ARGS);
110 extern Datum overlaps_period_periodset(PG_FUNCTION_ARGS);
111 extern Datum overlaps_periodset_periodset(PG_FUNCTION_ARGS);
112 
113 extern bool overlaps_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2);
114 extern bool overlaps_timestampset_period_internal(const TimestampSet *ts, const Period *p);
115 extern bool overlaps_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
116 extern bool overlaps_period_period_internal(const Period *p1, const Period *p2);
117 extern bool overlaps_period_periodset_internal(const Period *p, const PeriodSet *ps);
118 extern bool overlaps_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
119 
120 /* before */
121 
122 extern Datum before_timestamp_timestampset(PG_FUNCTION_ARGS);
123 extern Datum before_timestamp_period(PG_FUNCTION_ARGS);
124 extern Datum before_timestamp_periodset(PG_FUNCTION_ARGS);
125 extern Datum before_timestampset_timestamp(PG_FUNCTION_ARGS);
126 extern Datum before_timestampset_timestampset(PG_FUNCTION_ARGS);
127 extern Datum before_timestampset_period(PG_FUNCTION_ARGS);
128 extern Datum before_timestampset_periodset(PG_FUNCTION_ARGS);
129 extern Datum before_period_timestamp(PG_FUNCTION_ARGS);
130 extern Datum before_period_period(PG_FUNCTION_ARGS);
131 extern Datum before_periodset_timestampset(PG_FUNCTION_ARGS);
132 extern Datum before_period_timestampset(PG_FUNCTION_ARGS);
133 extern Datum before_periodset_timestamp(PG_FUNCTION_ARGS);
134 extern Datum before_periodset_period(PG_FUNCTION_ARGS);
135 extern Datum before_period_periodset(PG_FUNCTION_ARGS);
136 extern Datum before_periodset_periodset(PG_FUNCTION_ARGS);
137 
138 extern bool before_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts);
139 extern bool before_timestamp_period_internal(TimestampTz t, const Period *p);
140 extern bool before_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps);
141 extern bool before_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
142 extern bool before_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2);
143 extern bool before_timestampset_period_internal(const TimestampSet *ts, const Period *p);
144 extern bool before_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
145 extern bool before_period_timestamp_internal(const Period *p, TimestampTz t);
146 extern bool before_period_period_internal(const Period *p1, const Period *p2);
147 extern bool before_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
148 extern bool before_period_timestampset_internal(const Period *p, const TimestampSet *ts);
149 extern bool before_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
150 extern bool before_periodset_period_internal(const PeriodSet *ps, const Period *p);
151 extern bool before_period_periodset_internal(const Period *p, const PeriodSet *ps);
152 extern bool before_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
153 
154 /* after */
155 
156 extern Datum after_timestamp_timestampset(PG_FUNCTION_ARGS);
157 extern Datum after_timestamp_period(PG_FUNCTION_ARGS);
158 extern Datum after_timestamp_periodset(PG_FUNCTION_ARGS);
159 extern Datum after_timestampset_timestamp(PG_FUNCTION_ARGS);
160 extern Datum after_timestampset_timestampset(PG_FUNCTION_ARGS);
161 extern Datum after_timestampset_period(PG_FUNCTION_ARGS);
162 extern Datum after_timestampset_periodset(PG_FUNCTION_ARGS);
163 extern Datum after_period_timestamp(PG_FUNCTION_ARGS);
164 extern Datum after_period_period(PG_FUNCTION_ARGS);
165 extern Datum after_periodset_timestampset(PG_FUNCTION_ARGS);
166 extern Datum after_period_timestampset(PG_FUNCTION_ARGS);
167 extern Datum after_periodset_timestamp(PG_FUNCTION_ARGS);
168 extern Datum after_periodset_period(PG_FUNCTION_ARGS);
169 extern Datum after_period_periodset(PG_FUNCTION_ARGS);
170 extern Datum after_periodset_periodset(PG_FUNCTION_ARGS);
171 
172 extern bool after_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts);
173 extern bool after_timestamp_period_internal(TimestampTz t, const Period *p);
174 extern bool after_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps);
175 extern bool after_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
176 extern bool after_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2);
177 extern bool after_timestampset_period_internal(const TimestampSet *ts, const Period *p);
178 extern bool after_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
179 extern bool after_period_timestamp_internal(const Period *p, TimestampTz t);
180 extern bool after_period_period_internal(const Period *p1, const Period *p2);
181 extern bool after_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
182 extern bool after_period_timestampset_internal(const Period *p, const TimestampSet *ts);
183 extern bool after_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
184 extern bool after_periodset_period_internal(const PeriodSet *ps, const Period *p);
185 extern bool after_period_periodset_internal(const Period *p, const PeriodSet *ps);
186 extern bool after_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
187 
188 /* overbefore */
189 
190 extern Datum overbefore_timestamp_timestampset(PG_FUNCTION_ARGS);
191 extern Datum overbefore_timestamp_period(PG_FUNCTION_ARGS);
192 extern Datum overbefore_timestamp_periodset(PG_FUNCTION_ARGS);
193 extern Datum overbefore_timestampset_timestamp(PG_FUNCTION_ARGS);
194 extern Datum overbefore_timestampset_timestampset(PG_FUNCTION_ARGS);
195 extern Datum overbefore_timestampset_period(PG_FUNCTION_ARGS);
196 extern Datum overbefore_timestampset_periodset(PG_FUNCTION_ARGS);
197 extern Datum overbefore_period_timestamp(PG_FUNCTION_ARGS);
198 extern Datum overbefore_period_period(PG_FUNCTION_ARGS);
199 extern Datum overbefore_periodset_timestampset(PG_FUNCTION_ARGS);
200 extern Datum overbefore_period_timestampset(PG_FUNCTION_ARGS);
201 extern Datum overbefore_periodset_timestamp(PG_FUNCTION_ARGS);
202 extern Datum overbefore_periodset_period(PG_FUNCTION_ARGS);
203 extern Datum overbefore_period_periodset(PG_FUNCTION_ARGS);
204 extern Datum overbefore_periodset_periodset(PG_FUNCTION_ARGS);
205 
206 extern bool overbefore_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts);
207 extern bool overbefore_timestamp_period_internal(TimestampTz t, const Period *p);
208 extern bool overbefore_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps);
209 extern bool overbefore_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
211 extern bool overbefore_timestampset_period_internal(const TimestampSet *ts, const Period *p);
212 extern bool overbefore_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
213 extern bool overbefore_period_timestamp_internal(const Period *p, TimestampTz t);
214 extern bool overbefore_period_period_internal(const Period *p1, const Period *p2);
215 extern bool overbefore_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
216 extern bool overbefore_period_timestampset_internal(const Period *p, const TimestampSet *ts);
217 extern bool overbefore_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
218 extern bool overbefore_periodset_period_internal(const PeriodSet *ps, const Period *p);
219 extern bool overbefore_period_periodset_internal(const Period *p, const PeriodSet *ps);
220 extern bool overbefore_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
221 
222 /* overafter */
223 
224 extern Datum overafter_timestamp_timestampset(PG_FUNCTION_ARGS);
225 extern Datum overafter_timestamp_period(PG_FUNCTION_ARGS);
226 extern Datum overafter_timestamp_periodset(PG_FUNCTION_ARGS);
227 extern Datum overafter_timestampset_timestamp(PG_FUNCTION_ARGS);
228 extern Datum overafter_timestampset_timestampset(PG_FUNCTION_ARGS);
229 extern Datum overafter_timestampset_period(PG_FUNCTION_ARGS);
230 extern Datum overafter_timestampset_periodset(PG_FUNCTION_ARGS);
231 extern Datum overafter_period_timestamp(PG_FUNCTION_ARGS);
232 extern Datum overafter_period_period(PG_FUNCTION_ARGS);
233 extern Datum overafter_periodset_timestampset(PG_FUNCTION_ARGS);
234 extern Datum overafter_period_timestampset(PG_FUNCTION_ARGS);
235 extern Datum overafter_periodset_timestamp(PG_FUNCTION_ARGS);
236 extern Datum overafter_periodset_period(PG_FUNCTION_ARGS);
237 extern Datum overafter_period_periodset(PG_FUNCTION_ARGS);
238 extern Datum overafter_periodset_periodset(PG_FUNCTION_ARGS);
239 
240 extern bool overafter_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts);
241 extern bool overafter_timestamp_period_internal(TimestampTz t, const Period *p);
242 extern bool overafter_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps);
243 extern bool overafter_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
245 extern bool overafter_timestampset_period_internal(const TimestampSet *ts, const Period *p);
246 extern bool overafter_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
247 extern bool overafter_period_timestamp_internal(const Period *p, TimestampTz t);
248 extern bool overafter_period_period_internal(const Period *p1, const Period *p2);
249 extern bool overafter_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
250 extern bool overafter_period_timestampset_internal(const Period *p, const TimestampSet *ts);
251 extern bool overafter_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
252 extern bool overafter_periodset_period_internal(const PeriodSet *ps, const Period *p);
253 extern bool overafter_period_periodset_internal(const Period *p, const PeriodSet *ps);
254 extern bool overafter_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
255 
256 /* adjacent */
257 
258 extern Datum adjacent_timestamp_period(PG_FUNCTION_ARGS);
259 extern Datum adjacent_timestamp_periodset(PG_FUNCTION_ARGS);
260 extern Datum adjacent_timestampset_period(PG_FUNCTION_ARGS);
261 extern Datum adjacent_timestampset_periodset(PG_FUNCTION_ARGS);
262 extern Datum adjacent_period_timestamp(PG_FUNCTION_ARGS);
263 extern Datum adjacent_period_timestampset(PG_FUNCTION_ARGS);
264 extern Datum adjacent_period_period(PG_FUNCTION_ARGS);
265 extern Datum adjacent_period_periodset(PG_FUNCTION_ARGS);
266 extern Datum adjacent_periodset_timestamp(PG_FUNCTION_ARGS);
267 extern Datum adjacent_periodset_timestampset(PG_FUNCTION_ARGS);
268 extern Datum adjacent_periodset_period(PG_FUNCTION_ARGS);
269 extern Datum adjacent_periodset_periodset(PG_FUNCTION_ARGS);
270 
271 extern bool adjacent_timestamp_period_internal(TimestampTz t, const Period *p);
272 extern bool adjacent_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps);
273 extern bool adjacent_timestampset_period_internal(const TimestampSet *ts, const Period *p);
274 extern bool adjacent_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps);
275 extern bool adjacent_period_timestamp_internal(const Period *p, TimestampTz t);
276 extern bool adjacent_period_timestampset_internal(const Period *p, const TimestampSet *ts);
277 extern bool adjacent_period_period_internal(const Period *p1, const Period *p2);
278 extern bool adjacent_period_periodset_internal(const Period *p, const PeriodSet *ps);
279 extern bool adjacent_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
280 extern bool adjacent_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts);
281 extern bool adjacent_periodset_period_internal(const PeriodSet *ps, const Period *p);
282 extern bool adjacent_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
283 
284 /* union */
285 
286 extern Datum union_timestamp_timestamp(PG_FUNCTION_ARGS);
287 extern Datum union_timestamp_timestampset(PG_FUNCTION_ARGS);
288 extern Datum union_timestamp_period(PG_FUNCTION_ARGS);
289 extern Datum union_timestamp_periodset(PG_FUNCTION_ARGS);
290 extern Datum union_timestampset_timestamp(PG_FUNCTION_ARGS);
291 extern Datum union_timestampset_timestampset(PG_FUNCTION_ARGS);
292 extern Datum union_timestampset_period(PG_FUNCTION_ARGS);
293 extern Datum union_timestampset_periodset(PG_FUNCTION_ARGS);
294 extern Datum union_period_timestamp(PG_FUNCTION_ARGS);
295 extern Datum union_period_timestampset(PG_FUNCTION_ARGS);
296 extern Datum union_period_period(PG_FUNCTION_ARGS);
297 extern Datum union_period_periodset(PG_FUNCTION_ARGS);
298 extern Datum union_periodset_timestamp(PG_FUNCTION_ARGS);
299 extern Datum union_periodset_timestampset(PG_FUNCTION_ARGS);
300 extern Datum union_periodset_period(PG_FUNCTION_ARGS);
301 extern Datum union_periodset_periodset(PG_FUNCTION_ARGS);
302 
303 extern TimestampSet *union_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts);
305 extern PeriodSet *union_period_period_internal(const Period *p1, const Period *p2);
306 extern PeriodSet *union_period_periodset_internal(const Period *p, const PeriodSet *ps);
307 extern PeriodSet *union_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
308 
309 /* intersection */
310 
311 extern Datum intersection_timestamp_timestamp(PG_FUNCTION_ARGS);
312 extern Datum intersection_timestamp_timestampset(PG_FUNCTION_ARGS);
313 extern Datum intersection_timestamp_period(PG_FUNCTION_ARGS);
314 extern Datum intersection_timestamp_periodset(PG_FUNCTION_ARGS);
315 extern Datum intersection_timestampset_timestamp(PG_FUNCTION_ARGS);
316 extern Datum intersection_timestampset_timestampset(PG_FUNCTION_ARGS);
317 extern Datum intersection_timestampset_period(PG_FUNCTION_ARGS);
318 extern Datum intersection_timestampset_periodset(PG_FUNCTION_ARGS);
319 extern Datum intersection_period_timestamp(PG_FUNCTION_ARGS);
320 extern Datum intersection_period_timestampset(PG_FUNCTION_ARGS);
321 extern Datum intersection_period_period(PG_FUNCTION_ARGS);
322 extern Datum intersection_period_periodset(PG_FUNCTION_ARGS);
323 extern Datum intersection_periodset_timestamp(PG_FUNCTION_ARGS);
324 extern Datum intersection_periodset_timestampset(PG_FUNCTION_ARGS);
325 extern Datum intersection_periodset_period(PG_FUNCTION_ARGS);
326 extern Datum intersection_periodset_periodset(PG_FUNCTION_ARGS);
327 
330 extern Period *intersection_period_period_internal(const Period *p1, const Period *p2);
333 
334 /* minus */
335 
336 extern Datum minus_timestamp_timestamp(PG_FUNCTION_ARGS);
337 extern Datum minus_timestamp_timestampset(PG_FUNCTION_ARGS);
338 extern Datum minus_timestamp_period(PG_FUNCTION_ARGS);
339 extern Datum minus_timestamp_periodset(PG_FUNCTION_ARGS);
340 extern Datum minus_timestampset_timestamp(PG_FUNCTION_ARGS);
341 extern Datum minus_timestampset_timestampset(PG_FUNCTION_ARGS);
342 extern Datum minus_timestampset_period(PG_FUNCTION_ARGS);
343 extern Datum minus_timestampset_periodset(PG_FUNCTION_ARGS);
344 extern Datum minus_period_timestamp(PG_FUNCTION_ARGS);
345 extern Datum minus_period_timestampset(PG_FUNCTION_ARGS);
346 extern Datum minus_period_period(PG_FUNCTION_ARGS);
347 extern Datum minus_period_periodset(PG_FUNCTION_ARGS);
348 extern Datum minus_periodset_timestamp(PG_FUNCTION_ARGS);
349 extern Datum minus_periodset_timestampset(PG_FUNCTION_ARGS);
350 extern Datum minus_periodset_period(PG_FUNCTION_ARGS);
351 extern Datum minus_periodset_periodset(PG_FUNCTION_ARGS);
352 
353 extern TimestampSet *minus_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t);
357 extern PeriodSet *minus_period_timestamp_internal(const Period *p, TimestampTz t);
359 extern PeriodSet *minus_period_period_internal(const Period *p1, const Period *p2);
360 extern PeriodSet *minus_period_periodset_internal(const Period *p, const PeriodSet *ps);
361 extern PeriodSet *minus_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t);
363 extern PeriodSet *minus_periodset_period_internal(const PeriodSet *ps, const Period *p);
364 extern PeriodSet *minus_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2);
365 
366 #endif
367 
368 /*****************************************************************************/
bool overafter_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2340
Datum adjacent_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2583
Datum before_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1134
bool overafter_period_timestamp_internal(const Period *p, TimestampTz t)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2367
TimestampSet * minus_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3846
Datum union_periodset_timestampset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3153
bool overlaps_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:812
Structure to represent periods.
Definition: timetypes.h:52
bool before_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1251
TimestampSet * intersection_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3380
Datum union_timestamp_periodset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2940
Datum overbefore_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2172
bool after_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1504
TimestampSet * minus_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3793
RelativeTimePos
Enumeration for the relative position of a given element into a skiplist.
Definition: timeops.h:48
Datum intersection_period_timestamp(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3462
PeriodSet * minus_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4149
PeriodSet * minus_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4188
bool after_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1729
bool after_period_timestamp_internal(const Period *p, TimestampTz t)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1608
Datum contained_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:712
Datum overlaps_period_periodset(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:956
Datum minus_timestamp_period(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3722
PeriodSet * intersection_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3628
bool before_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1401
bool overafter_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2263
bool overbefore_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1909
Datum adjacent_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2673
bool overlaps_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:998
bool overafter_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2437
Datum before_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1361
void ensure_time_type_oid(Oid timetypid)
Ensure that the Oid corresponds to a time type.
Definition: timeops.c:60
Datum before_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1287
Datum after_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1690
PeriodSet * union_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns the union of the two time values (internal function)
Definition: timeops.c:3106
bool adjacent_timestamp_period_internal(TimestampTz t, const Period *p)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2568
bool overbefore_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2108
TimestampSet * intersection_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3407
TimestampSet * minus_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3755
Datum minus_timestamp_timestamp(PG_FUNCTION_ARGS)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3692
bool overafter_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2487
Datum minus_period_timestampset(PG_FUNCTION_ARGS)
Returns the difference of the two time valuess.
Definition: timeops.c:3961
Datum contained_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:673
Datum after_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1515
Datum union_periodset_periodset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3284
bool before_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1050
Datum intersection_periodset_period(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3613
bool adjacent_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
bool overbefore_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2058
bool after_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1556
bool overlaps_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:769
Datum contains_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:519
Datum contains_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:487
bool contains_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:397
Datum overafter_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2400
TimestampSet * union_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns the union of the two time values (internal function)
Definition: timeops.c:2971
Datum overafter_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2448
Datum overbefore_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2046
bool overbefore_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1811
bool contains_period_timestamp_internal(const Period *p, TimestampTz t)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:341
Datum after_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1642
Datum intersection_periodset_timestampset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3596
Datum overbefore_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1847
bool adjacent_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2654
Datum overafter_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2551
Datum overbefore_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2021
bool overbefore_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2010
Datum before_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1061
Datum overlaps_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:970
Datum minus_periodset_timestampset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:4300
Datum minus_period_timestamp(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3926
Datum contains_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:443
Datum overafter_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2525
bool adjacent_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Datum union_period_timestampset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3079
Datum adjacent_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2611
Datum overafter_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2326
bool overbefore_period_timestamp_internal(const Period *p, TimestampTz t)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1988
bool overbefore_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2160
PeriodSet * minus_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4355
Datum union_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2911
bool overafter_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2238
Datum adjacent_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2831
Datum union_period_timestamp(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3064
PeriodSet * intersection_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3528
Datum contains_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:359
Datum before_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1109
bool before_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1148
Datum after_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1442
Datum before_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1335
bool before_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1349
bool before_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1276
Datum overbefore_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1998
Datum contained_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:687
Datum union_timestampset_periodset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3012
bool adjacent_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
bool adjacent_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2812
Datum minus_timestampset_period(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3830
bool after_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1431
bool contained_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value is contained by the second one (internal function) ...
Definition: timeops.c:702
Datum minus_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3778
bool after_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1479
Datum minus_periodset_timestamp(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:4173
Datum minus_periodset_periodset(PG_FUNCTION_ARGS)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4410
bool before_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1376
bool before_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1299
bool contains_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:532
Datum overafter_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2425
Datum contains_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:414
Datum adjacent_period_period(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2728
Datum contained_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:632
Datum after_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1593
Datum union_periodset_period(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3170
bool after_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1529
bool overbefore_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2035
Structure to represent period sets.
Definition: timetypes.h:84
Datum before_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1310
bool adjacent_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2739
bool after_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1581
PeriodSet * minus_period_periodset_internal(const Period *p, const PeriodSet *ps)
Definition: timeops.c:4114
bool contains_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:501
Datum before_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1160
Datum intersection_timestamp_timestamp(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3303
Datum minus_periodset_period(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:4340
Datum intersection_timestamp_period(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3333
Datum overlaps_period_period(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:919
Datum contained_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:738
Datum adjacent_periodset_period(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2799
bool overafter_timestamp_period_internal(TimestampTz t, const Period *p)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2215
Datum overbefore_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1895
bool overbefore_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1884
Datum overafter_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2300
Datum union_timestamp_timestamp(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2850
bool before_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1123
bool before_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1175
Datum overafter_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2377
Datum intersection_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3317
Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet...
Datum contains_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:543
Datum overbefore_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2146
Datum before_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1413
PeriodSet * minus_period_timestamp_internal(const Period *p, TimestampTz t)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3908
Datum after_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1793
bool overafter_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2315
Datum overafter_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2249
Datum overafter_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2201
bool after_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1631
Datum after_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1541
bool before_period_timestamp_internal(const Period *p, TimestampTz t)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1227
Datum contained_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:644
Datum union_period_periodset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3121
Datum intersection_period_timestampset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3478
Datum overbefore_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1822
Structure to represent timestamp sets.
Definition: timetypes.h:73
bool after_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1704
Datum intersection_periodset_timestamp(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3580
Datum adjacent_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2770
PeriodSet * union_period_period_internal(const Period *p1, const Period *p2)
Returns the union of the two time values (internal function)
Definition: timeops.c:3030
bool overbefore_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1859
bool after_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1781
Datum after_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1715
Datum intersection_timestampset_periodset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3443
bool adjacent_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2594
Datum contained_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:752
Datum after_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1767
bool after_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1656
TimestampSet * minus_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3820
Datum minus_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3706
bool overafter_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2514
Datum overbefore_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1947
Datum overafter_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2352
Datum after_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1567
Datum after_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1490
Datum contained_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:724
Datum overbefore_period_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2069
Datum minus_timestamp_periodset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3738
Datum union_periodset_timestamp(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3137
bool contains_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:370
bool before_timestamp_periodset_internal(TimestampTz t, const PeriodSet *ps)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1098
Datum overafter_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2499
Datum adjacent_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2700
bool overbefore_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1961
Datum contained_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:658
Datum contained_timestamp_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is contained by the second one.
Definition: timeops.c:618
Datum minus_period_periodset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:4132
Datum adjacent_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2641
bool after_timestamp_period_internal(TimestampTz t, const Period *p)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1456
Datum union_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2958
Datum contains_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:283
Datum overafter_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2226
Datum before_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1262
PeriodSet * minus_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4316
Datum intersection_period_period(PG_FUNCTION_ARGS)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3514
bool contains_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:296
bool before_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1324
Datum intersection_period_periodset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3562
Datum overlaps_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:889
Datum after_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1619
Datum overlaps_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:798
bool after_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1756
bool contains_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:556
Definition: timeops.h:51
Datum before_periodset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1387
bool contains_timestampset_timestamp_internal(const TimestampSet *ts, TimestampTz t)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:267
bool overafter_timestampset_timestampset_internal(const TimestampSet *ts1, const TimestampSet *ts2)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2288
Datum minus_period_period(PG_FUNCTION_ARGS)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4060
bool overlaps_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:930
Datum union_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2981
Datum adjacent_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2784
Datum overlaps_periodset_period(PG_FUNCTION_ARGS)
Returns true if the two time values overlap.
Definition: timeops.c:985
bool before_timestamp_period_internal(TimestampTz t, const Period *p)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1075
bool overbefore_timestamp_period_internal(TimestampTz t, const Period *p)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1836
bool adjacent_period_period_internal(const Period *p1, const Period *p2)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2713
Datum intersection_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3391
bool adjacent_periodset_period_internal(const PeriodSet *ps, const Period *p)
TimestampSet * union_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts)
Returns the union of the two time values (internal function)
Definition: timeops.c:2880
Datum intersection_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3365
Datum before_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1086
bool overbefore_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:1936
Period * intersection_period_period_internal(const Period *p1, const Period *p2)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3494
Datum union_timestampset_period(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2996
Datum after_period_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1667
Datum contains_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:327
bool overlaps_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:846
Datum union_timestamp_period(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:2925
bool adjacent_timestampset_period_internal(const TimestampSet *ts, const Period *p)
Returns true if the two time value are adjacent (internal function)
Definition: timeops.c:2624
Datum overbefore_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2120
Datum before_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1212
Datum overbefore_timestamp_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1870
bool overbefore_periodset_period_internal(const PeriodSet *ps, const Period *p)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2135
Datum overbefore_timestampset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1973
Datum intersection_timestamp_periodset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3349
RelativeTimePos pos_timestamp_timestamp(TimestampTz t1, TimestampTz t2)
Determine the relative position of the two timestamps.
Definition: timeops.c:73
Datum intersection_timestampset_period(PG_FUNCTION_ARGS)
Returns the intersection of the two time values (internal function)
Definition: timeops.c:3417
Datum before_timestampset_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1186
Datum after_timestamp_period(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1467
Datum minus_timestampset_periodset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3857
bool before_timestampset_periodset_internal(const TimestampSet *ts, const PeriodSet *ps)
Returns true if the first time value is strictly before the second one (internal function) ...
Definition: timeops.c:1200
bool after_period_periodset_internal(const Period *p, const PeriodSet *ps)
Returns true if the first time value is strictly after the second one (internal function) ...
Definition: timeops.c:1679
PeriodSet * union_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns the union of the two time values (internal function)
Definition: timeops.c:3183
Datum contains_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:600
Datum overbefore_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:2094
bool overafter_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2462
Datum minus_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns the difference of the two time values.
Definition: timeops.c:3804
bool overbefore_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns true if the first time value is not after the second one (internal function) ...
Definition: timeops.c:2083
Datum union_period_period(PG_FUNCTION_ARGS)
Returns the union of the two time values.
Definition: timeops.c:3095
RelativeTimePos pos_period_timestamp(const Period *p, TimestampTz t)
Determine the relative position of the period and the timestamp.
Definition: timeops.c:87
Definition: timeops.h:52
Datum contains_period_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value contains the second one.
Definition: timeops.c:384
Datum overafter_periodset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2473
Datum overbefore_timestampset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is not after the second one.
Definition: timeops.c:1921
bool overlaps_period_period_internal(const Period *p1, const Period *p2)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:902
bool overafter_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2389
bool contains_periodset_timestampset_internal(const PeriodSet *ps, const TimestampSet *ts)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:456
PeriodSet * minus_period_timestampset_internal(const Period *p, const TimestampSet *ts)
Returns the difference of the two time values (internal function)
Definition: timeops.c:3941
bool overafter_periodset_periodset_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2539
Datum overlaps_periodset_periodset(PG_FUNCTION_ARGS)
Returns true if the two time values overlap (internal function)
Definition: timeops.c:1032
bool contains_periodset_timestamp_internal(const PeriodSet *ps, TimestampTz t)
Returns true if the first time value contains the second one (internal function)
Definition: timeops.c:425
bool overafter_period_period_internal(const Period *p1, const Period *p2)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2414
bool overafter_timestamp_timestampset_internal(TimestampTz t, const TimestampSet *ts)
Returns true if the first time value is not before the second one (internal function) ...
Definition: timeops.c:2190
Datum before_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly before the second one.
Definition: timeops.c:1239
bool adjacent_period_timestamp_internal(const Period *p, TimestampTz t)
PeriodSet * minus_period_period_internal(const Period *p1, const Period *p2)
Returns the difference of the two time values (internal function)
Definition: timeops.c:4042
Datum after_periodset_timestampset(PG_FUNCTION_ARGS)
Returns true if the first time value is strictly after the second one.
Definition: timeops.c:1741
Datum adjacent_period_timestamp(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2688
Definition: timeops.h:50
Datum intersection_periodset_periodset(PG_FUNCTION_ARGS)
Returns the intersection of the two time values.
Definition: timeops.c:3670
Datum adjacent_period_periodset(PG_FUNCTION_ARGS)
Returns true if the two time value are adjacent.
Definition: timeops.c:2756
Datum overafter_timestampset_timestamp(PG_FUNCTION_ARGS)
Returns true if the first time value is not before the second one.
Definition: timeops.c:2274