Re: creating CHECK constraints as NOT VALID

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: creating CHECK constraints as NOT VALID
Дата
Msg-id 1308015476-sup-9241@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: creating CHECK constraints as NOT VALID  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: creating CHECK constraints as NOT VALID  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Excerpts from Josh Berkus's message of lun jun 13 18:11:54 -0400 2011:
> Alvaro,  Dean,
> 
> >> I think that you also need to update the constraint exclusion code
> >> > (get_relation_constraints() or nearby), otherwise the planner might
> >> > exclude a relation on the basis of a CHECK constraint that is not
> >> > currently VALID.
> > Ouch, yeah, thanks for pointing that out.  Fortunately the patch to fix
> > this is quite simple.  I don't have it handy right now but I'll post it
> > soon.
> 
> Hmmm. Is this the behavior we want with NOT VALID constraints though?
> 
> I know that if I'm pouring 100m rows into a new partition as part of a
> repartitioning scheme, I don't want to *ever* check them if I know
> they're correct because of how I created the table (CREATE TABLE AS ...).

Well, if we don't validate the data, it's an open door for potentially
corrupt query results.  I'm not really sure that we want to provide
support for "I don't ever want to check this data for validity" because
of that.  But then, I just work here.

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


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: SSI patch renumbered existing 2PC resource managers??
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: pgbench cpu overhead (was Re: lazy vxid locks, v1)