constraint help

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема constraint help
Дата
Msg-id 407D73E8.3090807@fireserve.net
обсуждение исходный текст
Ответы Re: constraint help  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: constraint help  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
I will have a table with, among other things, two time columns.
As per my last post, I will be using a variable time for the day-to-day
boundary, versus the traditional 12pm.
What I want to be able to do upon insert of a record with a pair of
times is to determine if the day to day boundary is between the times
that are in the record, and reject the record if that is true.
For example, if the system wide constant for the day-to-day boundary
were 4AM local time, and I submitted a record like so:
    INSERT INTO my_table(start_time, end_time) VALUES( '12:00'::TIME,
'14:30'::TIME );

that should succeed. However:
    INSERT INTO my_table(start_time, end_time) VALUES( '12:00'::TIME,
'5:00'::TIME );

should fail.
Any ideas wold be most appreciated.


В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Gearon
Дата:
Сообщение: major-domo not set up right
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Donating