Re: violates not-null constraint question.

From: Mike Kienenberger (mkienen..mail.com)
Date: Sat Mar 11 2006 - 16:33:52 EST

  • Next message: WONDER: "Re: violates not-null constraint question."

    It looks like you have set the is_active field as "allows null" in the
    modeler, but you have set the database constraints to be "disallows
    null".

    Have you tried recreating the table after making the mandatory change?
      Or altering the table column to be nullable?

    -Mike

    On 3/11/06, WONDER <mmmmmmmmm5..eb.de> wrote:
    > Hello,
    >
    > CREATE TABLE account
    > (
    > id int4 NOT NULL,
    > username varchar(50) NOT NULL,
    > "password" varchar(100) NOT NULL,
    > is_checked bool DEFAULT false,
    >
    > ...
    >
    > In the Model i have unchecked DbEntity.Mandatory for "is_active" to false.
    >
    > I get this error
    >
    > ERROR: null value in column "is_active" violates not-null constraint
    >
    > Is there any way to get arround this?
    >
    > I really dont know what sence does it make to send a NULL value to the DB as
    >
    > ----------------------------------------------------------------
    >
    > INSERT INTO public.account (id, inactive_username, is_active, is_checked,
    > password, username) VALUES (?, ?, ?, ?, ?, ?)
    >
    > [batch bind: 47, NULL, NULL, 'false', '*****', 'XXXXX']
    >
    > ----------------------------------------------------------------
    >
    > It makes the default value technique useless, i hope there is way to disable
    > this.
    >
    >
    >
    > Sako.
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Sat Mar 11 2006 - 16:33:54 EST