Re: NOT NULL constraints in foreign tables

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: NOT NULL constraints in foreign tables
Дата
Msg-id 1345492593.14847.6.camel@sussancws0025
обсуждение исходный текст
Ответ на Re: NOT NULL constraints in foreign tables  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: NOT NULL constraints in foreign tables
Список pgsql-hackers
On Fri, 2012-08-17 at 15:44 -0400, Robert Haas wrote:
> On Fri, Aug 17, 2012 at 2:58 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > I mean, what are NOT NULL in foreign tables for?  Are they harmed or
> > helped by having pg_constraint rows?
> 
> As I've mentioned when this has come up before, I think that
> constraints on foreign tables should be viewed as declarative
> statements about the contents of the foreign data that the DB will
> assume true.  This could be useful for a variety of purposes:
> constraint exclusion, query optimization, etc.

There are at least three kinds of constraint enforcement:

1. Enforced before the query runs (e.g. the current behavior on a normal
table).

2. Enforced when the query runs by validating the constraint as you go,
and then throwing an error when it turns out to be false.

3. Don't make any attempt to enforce, and silently produce wrong results
if it's false.

Which are you proposing, and how will the user know which kind of
constraint they've got?

Regards,Jeff Davis




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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: PATCH: psql boolean display
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: sha1, sha2 functions into core?