Re: How to find earlest possible start times for given duration excluding reservations - Mailing list pgsql-general

From Andrus
Subject Re: How to find earlest possible start times for given duration excluding reservations
Date
Msg-id B77ECACB05844A1C9E53552B312149D2@dell2
Whole thread Raw
In response to Re: How to find earlest possible start times for given duration excluding reservations  (Thom Brown <thom@linux.com>)
List pgsql-general
Hi!

>A further tweak; add the following to the WHERE clause:
>AND EXTRACT(DOW FROM times.period) != 0

I changed it to isodow to work in any locale.

Your solution is more readable but Erwin answer in SO looks more optimized.
I have 10 workes and 1 month reservation with 15 minute offsess from 8 to
20:00, so perfomance is hopafully not an issue. Which to use ?

Using current_date in check constraint causes database restore failure.
not valid should be added or this check should be moved to holydays check
trigger.

Andrus.



pgsql-general by date:

Previous
From: VENKTESH GUTTEDAR
Date:
Subject: Need Guidance on Appending new data to existing field of Json data type
Next
From: Michael Paquier
Date:
Subject: Re: Appending new data to existing field of Json data type