Re: A question about inheritance and sequence

Поиск
Список
Период
Сортировка
От Marko Pahić
Тема Re: A question about inheritance and sequence
Дата
Msg-id 4ae2a0950906241240y4627da43uc403e53ae2bf926d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: A question about inheritance and sequence  (Filip Rembiałkowski <plk.zuber@gmail.com>)
Список pgsql-general

Triggers are generally more robust. Quick example:
NEW.noteid := SELECT 1+ COALESCE( (SELECT noteid FROM "Notes" WHERE userkey=NEW.userkey ORDER BY noteid DESC LIMIT 1), 0 );

Can you please write me the whole trigger? I've been reading the manual for an hour and I have no idea in where to apply this code.


Applications must take care of race conditions (like 2 clients trying to insert same noteid).
 
Doesn't the multiple primary key key fix this problem?


--
Human beings make life so interesting.
Do you know that in a universe so full of wonder,
they have managed to invent boredom? Quite astonishing.

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

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: 8.4 RC1 on ubuntu 9.04 jaunty, problems after install
Следующее
От: Geoffrey
Дата:
Сообщение: Re: Replication