Not null constraint violation flagged on a field that has a value

From: Rob Richardson <interrobang(at)yahoo(dot)com>
To: "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Not null constraint violation flagged on a field that has a value
Date: 2018-08-09 19:06:42
Message-ID: 134363929.5244732.1533841602167@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Please see the attached image.  As you can see, a not-null constraint error is being raised for a field that actually is not null.  Please explain this.  
Here's the table definition:
-- Table: public.alarm_history
-- DROP TABLE public.alarm_history;
CREATE TABLE public.alarm_history(    alarm_history_pkey bigint NOT NULL,    area character varying(32) COLLATE pg_catalog."default" NOT NULL DEFAULT 'All'::character varying,    device character varying(32) COLLATE pg_catalog."default",    alarm_number smallint NOT NULL DEFAULT 0,    tag character varying(32) COLLATE pg_catalog."default",    state smallint NOT NULL,    message text COLLATE pg_catalog."default",    alarm_date timestamp with time zone,    charge integer,    ack_date timestamp with time zone,    ack_state integer NOT NULL DEFAULT 0,    furnace character varying(32) COLLATE pg_catalog."default",    cooling_cover character varying(32) COLLATE pg_catalog."default",    heating integer,    base character varying(32) COLLATE pg_catalog."default",    CONSTRAINT alarm_history_pk PRIMARY KEY (alarm_history_pkey),    CONSTRAINT alarm_history_base_fk FOREIGN KEY (area, base)        REFERENCES public.bases (area, base) MATCH SIMPLE        ON UPDATE NO ACTION        ON DELETE NO ACTION,    CONSTRAINT alarm_history_charge_fk FOREIGN KEY (charge)        REFERENCES public.charges (charge) MATCH SIMPLE        ON UPDATE NO ACTION        ON DELETE NO ACTION,    CONSTRAINT alarm_history_cooler_fk FOREIGN KEY (cooling_cover, area)        REFERENCES public.cooling_covers (cover, area) MATCH SIMPLE        ON UPDATE NO ACTION        ON DELETE NO ACTION,    CONSTRAINT alarm_history_device_fk FOREIGN KEY (device)        REFERENCES public.bases (alarm_device) MATCH SIMPLE        ON UPDATE NO ACTION        ON DELETE NO ACTION,    CONSTRAINT alarm_history_furnace_fk FOREIGN KEY (furnace, area)        REFERENCES public.furnaces (furnace, area) MATCH SIMPLE        ON UPDATE NO ACTION        ON DELETE NO ACTION)WITH (    OIDS = FALSE)TABLESPACE pg_default;
ALTER TABLE public.alarm_history    OWNER to caps;

Attachment Content-Type Size
not null constraint error.png image/png 157.5 KB

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Rob Richardson 2018-08-09 19:22:26 Re: Not null constraint violation flagged on a field that has a value
Previous Message Dave Page 2018-08-09 15:46:45 Re: Navigation through edit screen is very difficult