Search Postgresql Archives

Re: ERROR: check constraint - PostgreSQL 9.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Althought both options are technically correct, I guess that the first one is the only reasonable one. What is the point of having a
check constraint that is not checked? If all fields in the check constraint must not be null there must be a reason for it. Possibly
the "wrong" data is useless anyway (some test data that was not deleted) or the constraint only applies from a certain point in time
because something in the system built on top of it changed. In the latter case, since the data has a time stamp you may extend the
constraints to include the point in time from which it must apply.

Bye
Charles

> -----Original Message-----
> From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Christophe Pettus
> Sent: Montag, 25. Januar 2016 05:18
> To: Postgres General <pgsql-general@xxxxxxxxxxxxxx>
> Subject: Re:  ERROR: check constraint - PostgreSQL 9.2
> 
> 
> On Jan 24, 2016, at 8:12 PM, "drum.lucas@xxxxxxxxx" <drum.lucas@xxxxxxxxx> wrote:
> 
> > How can I solve the problem? How can I get the command successfully be done?
> 
> Two options:
> 
> 1. Fix the data.
> 
> 2. Use the NOT VALID option on ALTER TABLE ... ADD constraint, which allows the addition of a constraint without
> actually checking its validity.
> 
> --
> -- Christophe Pettus
>    xof@xxxxxxxxxxxx
> 
> 
> 
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux