2

I think the issue outlined in this question PostgreSQL default values in QGIS 2.8.1 and ticket #12391 is not fully solved yet. Negative numeric default values, and dates are not used by QGIS 2.8.2 correctly. When I work on them and save the layer, the default values were not computed, and the NOT NULL constraints block me. 2.6 works.

Example:

CREATE TABLE bla
(
  vres double precision NOT NULL DEFAULT (-32768.0),
  startvalid date NOT NULL DEFAULT '2001-01-01'::date
)

1 Answer 1

1

I have the same problem with char default values. Varchar, boolean and numeric are ok. Qgis version 2.8.5

drop table prova;
create table prova (
    gid serial primary key,
    test_bo varchar(100) default 'false' not null,
    test_bo2  varchar(100) default 'false' not null,
    geom geometry(Linestring,32632)
    );

Works

drop table prova2;
create table prova2 (
    gid serial primary key,
    test_bo char(1) default 'f' not null,
    test_bo2  char(1) default 'f' not null,
    geom geometry(Linestring,32632)
    );

Not working. test_bo and test_bo2 are NULL instead of default value.

Not the answer you're looking for? Browse other questions tagged or ask your own question.