Re: Multiple table relationship constraints

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Multiple table relationship constraints
Дата
Msg-id 014c01cc0b5c$d3b541f0$7b1fc5d0$@yahoo.com
обсуждение исходный текст
Ответ на Multiple table relationship constraints  (Jack Christensen <jackc@hylesanderson.edu>)
Ответы Re: Multiple table relationship constraints
Список pgsql-general
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Jack Christensen
> Sent: Thursday, May 05, 2011 3:20 PM
> To: pgsql
> Subject: [GENERAL] Multiple table relationship constraints
>
> 4. Validate application side -- this can work well, but it leaves the hole
of a
> bug in the application or a direct SQL statement going bad.
>
>
> Anyone have any advice on the best way to handle this?
>

Not totally following the usage though I have come across similar
requirements before.  A variant of #4 would be to remove
INSERT/UPDATE/DELETE permissions on the relevant tables and write SECURITY
DEFINER functions to perform those actions instead. You can additionally
leave the constraints loose and have the function query the tables
post-modification to make sure they are still valid (kind of like the
materialized view option but without a permanent table).

David J.



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

Предыдущее
От: Bosco Rama
Дата:
Сообщение: Re: Generating fields in views with search/replace?
Следующее
От: Jack Christensen
Дата:
Сообщение: Re: Multiple table relationship constraints