Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Adrian Klaver
On 02/25/2016 01:58 AM, Karsten Hilbert wrote: On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote: This works fine, the application (GNUmed) ensures INSERTS and UPDATES do the right thing with .is_ongoing and .ts_end. Now the following sequence happens: - insert row with .is_ongoin

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Karsten Hilbert
On Wed, Feb 24, 2016 at 05:24:44PM -0700, David G. Johnston wrote: > ​Then you must record the "INSERT/UPDATE time" into the table, as a > constant, and refer to that value instead of having "now()" which happens > to be correct at the time of the insert/update but is not correct at any > future p

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Karsten Hilbert
On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote: > >This works fine, the application (GNUmed) ensures INSERTS and > >UPDATES do the right thing with .is_ongoing and .ts_end. > > > >Now the following sequence happens: > > > >- insert row with .is_ongoing=true and .ts_end=tomorrow() >

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-24 Thread David G. Johnston
On Wed, Feb 24, 2016 at 3:12 PM, Karsten Hilbert wrote: > I have noticed another problem during pg_upgrade on a 9.1 > cluster with 9.4 as the target. > > Consider this sort of table > > create table therapy ( > pk serial primary key, > description text, >

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-24 Thread Adrian Klaver
On 02/24/2016 02:12 PM, Karsten Hilbert wrote: I have noticed another problem during pg_upgrade on a 9.1 cluster with 9.4 as the target. Consider this sort of table create table therapy ( pk serial primary key, description text, is_ongoing

[GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-24 Thread Karsten Hilbert
I have noticed another problem during pg_upgrade on a 9.1 cluster with 9.4 as the target. Consider this sort of table create table therapy ( pk serial primary key, description text, is_ongoing boolean not null, ts_end timesta

Re: [GENERAL] Check Constraint problem

2005-07-01 Thread Michael Schmidt
The solutions provided by Mr. Glaeserman and Mr. Lane worked perfectly.  So that's how NULL works!    Thanks so much for the help.   

Re: [GENERAL] Check constraint problem

2005-06-30 Thread Tom Lane
"Michael Schmidt" <[EMAIL PROTECTED]> writes: > ALTER TABLE "ClinData" ADD CONSTRAINT "Control_Score" CHECK > ((("Control_Score_M" IS NULL) AND ("Control_Score_SD" IS NULL) ) OR > (("Control_Score_M" IS NOT NULL) AND ("Control_Score_SD" >= 0.0))) > This statement executes okay. It prevents Cont

Re: [GENERAL] Check constraint problem

2005-06-30 Thread Michael Glaesemann
On Jul 1, 2005, at 12:04 PM, Michael Schmidt wrote: The constraint statement: ALTER TABLE "ClinData" ADD CONSTRAINT "Control_Score" CHECK ((("Control_Score_M" IS NULL) AND ("Control_Score_SD" IS NULL) ) OR (("Control_Score_M" IS NOT NULL) AND ("Control_Score_SD" >= 0.0))) This statement execu

[GENERAL] Check constraint problem

2005-06-30 Thread Michael Schmidt
New to PostgreSQL and hoping for some help with a constraint I've been struggling with for a could of days.  The table includes means and standard deviations.  They should either both be null or (mean any value and standard deviation >= 0)   The constraint statement:   ALTER TABLE "ClinData"