My table has these columns:
priority double precision DEFAULT 0.5::double precision,
created_at timestamp without time zone DEFAULT now(),
But for the record that was just inserted the value is null:
Why doesn't it work?
Update: I've updated the flask-sqlalchemy row to:
priority = db.Column(db.Float, server_default=u'0.5', nullable=False)
and the table shows:
priority double precision NOT NULL DEFAULT 0.5::double precision,
but now it gives the error:
sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) null value in column "priority" violates not-null constraint
NULL
. How are you doing the insert? – Nick BarnesInsert
statement you are using. And you probably do not wantdouble
, for details see: floating-point-gui.de – a_horse_with_no_name