Re: How to find earlest possible start times for given duration excluding reservations

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: "Thom Brown" <thom(at)linux(dot)com>
Cc: "PGSQL Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find earlest possible start times for given duration excluding reservations
Date: 2014-10-29 07:10:35
Message-ID: B77ECACB05844A1C9E53552B312149D2@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2014-10-29 07:15:21 Re: Appending new data to existing field of Json data type
Previous Message VENKTESH GUTTEDAR 2014-10-29 07:05:23 Need Guidance on Appending new data to existing field of Json data type