Re: A question about inheritance and sequence

Поиск
Список
Период
Сортировка
Искать
От
Marko Pahić
Тема
Re: A question about inheritance and sequence
Дата
Msg-id
4ae2a0950906241240y4627da43uc403e53ae2bf926d@mail.gmail.com
Ответ на
Список
Дерево обсуждения
A question about inheritance and sequence Marko Pahić <mpahic@gmail.com>
Re: A question about inheritance and sequence Joshua Tolley <eggyknap@gmail.com>
Re: A question about inheritance and sequence Filip Rembiałkowski <plk.zuber@gmail.com>
Re: A question about inheritance and sequence Marko Pahić <mpahic@gmail.com>

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
Дата:
От: Geoffrey
Дата:
Сообщение: Re: Replication
FAQ