Skip to content

PostgreSQL mode, update with "from", why "NULL not allowed" error? #3543

@rafaello7

Description

@rafaello7

This is a problem with update-with-from functionality, which is supported in PostgreSQL mode. Try the following: open database in PostgreSQL mode, e.g. java -cp h2-2.1.214.jar org.h2.tools.Shell -url "jdbc:h2:./test;MODE=PostgreSQL" -user sa, then do the following:

    create table rec1 (id1 integer, id2 integer, val integer, primary key (id1, id2));
    update rec1 r set r.val = 1 from (values (1)) v (a) where r.id1 = v.a;

The following error is printed: Error: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "V.A";
There is no reason to have such error. Or, is it some?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions