Re: creating CHECK constraints as NOT VALID

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: creating CHECK constraints as NOT VALID
Дата
Msg-id 1307120026-sup-4605@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: creating CHECK constraints as NOT VALID  (Thom Brown <thom@linux.com>)
Ответы Re: creating CHECK constraints as NOT VALID  (Thom Brown <thom@linux.com>)
Список pgsql-hackers
Excerpts from Thom Brown's message of vie jun 03 12:47:58 -0400 2011:
> On 2 June 2011 17:48, Alvaro Herrera <alvherre@commandprompt.com> wrote:

> > Actually, it turns out that NOT VALID foreign keys were already buggy
> > here, and fixing them automatically fixes this case as well, because the
> > fix involves touching pg_get_constraintdef to dump the flag.  This also
> > gets it into psql's \d.  Patch attached.
> >
> > (Maybe the changes in psql's describe.c should be reverted, not sure.)
> 
> Nice work Alvaro :)  Shouldn't patches be sent to -hackers instead of
> the obsolete -patches list?  Plus I'm a bit confused as to why the
> patch looks like an email instead of a patch.

Did I really email pgsql-patches?  If so, I didn't notice -- but I don't
see it (and the archives seem to agree with me, there's no email after
2008-10).

The patch looks like an email because that's what git format-patch
produced, and I attached it instead of putting it inline.

> According to the SQL:2011 standard: "The SQL Standard allows you to
> turn the checking on and off for CHECK constraints, UNIQUE constraints
> and FOREIGN KEYS."
> 
> So is it much work to also add the ADD CONSTRAINT UNIQUE (column, ...)
> NOT VALID syntax to this too?  This would mean we're completely
> covered for this standards requirement.

Yeah, UNIQUE is a completely different beast.  There's already some work
on making them accept invalid (duplicate) values temporarily, but making
that more general, even if it was acceptable to the community at large
(which I'm not sure it is) is way beyond what I set to do here :-)

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Radosław Smogura
Дата:
Сообщение: Re: BLOB support
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Domains versus polymorphic functions, redux