Re: constraint and ordered value

Поиск
Список
Период
Сортировка
От David Garamond
Тема Re: constraint and ordered value
Дата
Msg-id 43B4216A.3080707@zara.6.isreserved.com
обсуждение исходный текст
Ответ на Re: constraint and ordered value  (Daryl Richter <daryl@eddl.us>)
Список pgsql-sql
Daryl Richter wrote:
>> No. A constraint only applies to one row at a time. If you try to 
>> work around
>> this by calling a function that does queries it isn't guarenteed to 
>> work.
>> And if you are thinking of calling a function that does a query,  you
>> aren't
>> looking at saving time over using triggers.
>>
>> Also, if you are going to have concurrent updates, you are going to 
>> need to
>> do table locking to make this work.
> 
> And, finally, you should ask yourself *why* are you doing this, given 
> that one of the fundamental properties of a table (relation) is that 
> the rows (tuples) are *unordered.*  So much of what makes a  relational
> db a wonderful thing for storing data depends on this notion.
> 
> If you provide an explanation of what you are trying to model,  perhaps
> we can help you find a better schema design.

Thanks for the insightful answers. Actually I'm just learning about and
trying out CHECK constraints in Postgres (and Firebird) :-)

Regards,
dave


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

Предыдущее
От: "Ken Winter"
Дата:
Сообщение: Arrays in PL/pgSQL routines?
Следующее
От: Bricklen Anderson
Дата:
Сообщение: Re: Arrays in PL/pgSQL routines?