Re: Checking number of entries

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: Checking number of entries
Дата
Msg-id 39E2740C.C7E1DE33@tpf.co.jp
обсуждение исходный текст
Ответ на Checking number of entries  (oberpwd@anubis.network.com (Wade D. Oberpriller))
Список pgsql-general

Stephan Szabo wrote:

>
> >The implementation would be quite different from
> >that of (current) column constraints.
> >I've been suspicious if it could be implemented
> >properly and effectively.
> >For example,are there any discussions about
> >locking needed to guarantee the consistency ?
> Not yet, and I'm not sure the backend even provides
> the necessary hooks right now (I haven't looked).
> For example, what rows get locked when you are
> checking a count(*) constraint (apart from grabbing
> a lock on all the tables involved).

Though it's not preferable, we should grab an exclusive
lock on all the tables for this case.


>  How do you
> prevent someone from inserting a new row that matches
> a criteria until your check is finished (locking
> non-existant rows).

AFAIK,we have no standard way to lock non-existent rows
now. I don't know such cases other than unique constraints.
I'm not sure that the technique is applicable to all cases.
The current simplest and practical way is to grab an exclusive
lock on the target tables. However it's not preferable of cource.

Regards.

Hiroshi Inoue


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

Предыдущее
От: Alex Pilosov
Дата:
Сообщение: Re: Oracle to POSTGRESQL
Следующее
От: bmccoy@chapelperilous.net
Дата:
Сообщение: Re: distinct