Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-1955

Postgres upgrade script (bpms-6.0-to-6.1.sql): null value in column "id" violates not-null constraint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 6.2.0
    • 6.1.0
    • jBPM Core
    • None

      • Description of problem:

      Using the database dump attached I ran the migration script [1] I the error [2] was shown.

      [1] - https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/db/upgrade-scripts/postgresql/bpms-6.0-to-6.1.sql
      [2] - ERROR: null value in column "id" violates not-null constraint SQL state: 23502

      • Version-Release number of selected component (if applicable):

      I was migrating from 6.0.3 to 6.1.3 using Postgres 9.2

      • How reproducible:

      You don't need Jboss BPMS to reproduce this. Just install Postgres 9.2

      • Steps to Reproduce:

      On Postgres 9.2:

      • Create a database;
      • Import the dump attached;
      • Try execute the whole upgrade script.
      • Actual results:

      ERROR: null value in column "id" violates not-null constraint SQL state: 23502

      • Expected results:

      No errors

      • Additional info:

      As a workaround I changed the script, to link the id column (from the table AuditTaskImpl) to the sequence AUDIT_ID_SEQ (See [3]).

      But I'm not sure if this is the best approach. If the persistence source code is putting the sequence using Hibernate this change which I made could lead to problems.

      Better have an official solution to this from the experts.

      -> Point of attention: In this change I placed single quotes in the nextval call but I got reports from people having the error because of this. So, if you got an error like [4] try remove the quote or put double quotes.

      [3] -
      ...
      create table AuditTaskImpl (
      id int8 DEFAULT nextval('AUDIT_ID_SEQ') not null,
      ...

      [4] -
      ERROR: relation “audit_id_seq” does not exist SQL state: 42P01

              kverlaen@redhat.com Kris Verlaenen
              acavalca Alexandre Cavalcanti (Inactive)
              Tibor Zimányi Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Alessandro Lazarotti, jperezve#1, Kris Verlaenen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: