Re: Novice DB Schema question

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Novice DB Schema question
Дата
Msg-id 200211041226.31167.josh@agliodbs.com
обсуждение исходный текст
Ответ на Novice DB Schema question  (Nick Sayer <nsayer@quack.kfu.com>)
Список pgsql-novice
"anonymous"

> I have a bit of a stumper.
>
> I'm writing an IMAP server. The goal it to achieve IMAP scalability by
> allowing a user to set up a fleet of thin servers to speak IMAP and push
> the scaling problem to the SQL layer (where the problem has been largely
> solved). This means I want to write it with PostgreSQL, but I want it to
> wind up being portable to whatever big iron someone might want to use.

Sounds like you should hire an experienced Postgres DBA, unless this is an
Open Source project.

> The only trick left is to arrange for a message to be deleted when its
> last messagemap entry is deleted.

Write a trigger, in PL/pgSQL, which executes whenever a record is deleted from
messagemap.   The trigger should check whether there are any mailboxes left
with that particular message; if not, delete it.

Triggers are covered in the online documentation.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


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

Предыдущее
От: "Ben Kassel"
Дата:
Сообщение: AutoIncrement not working on this table only
Следующее
От: Kassel Ben CRBE
Дата:
Сообщение: Re: AutoIncrement not working on this table only