Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Can't insert data to postgresql with JDBC, same data are accepted from pgadmin

  1. #1

    Default Can't insert data to postgresql with JDBC, same data are accepted from pgadmin

    Hi folks,
    Any hint on this, perhaps I'm only too tired to figure out my wrong doing ...:
    I tried to run this statement on pgadmin, which works without any trouble.
    The same on pdi with an already tested postgresql connection throws an error.
    I have already written with the existing table output step successfully. I also rerun this test.
    But with this specific data it's not working, I'm getting a message
    org.pentaho.di.core.exception.KettleDatabaseBatchException
    at
    org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1503)
    org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:658)
    org.pentaho.di.trans.step.RunThread.run(RunThread.java:79)
    java.lang.Thread.run(Unknown Source)

    at
    org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586)
    org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:459)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725)
    org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1486)

    I'm using Postgresql 9.2 and the enclosed jdbc connector on pdi 4.4.


    The statement:
    INSERT INTO il1 (measure, wbs, slice, productvariant, "dom-labour", licenses, hobids, total, filename, "date", cw, status) VALUES ( 'Decommissioning of applications with low or no usage', '9914.P00095', 'NGF7', 'SAP ISU-CCS project system H60 ', '0.0', '0.0', '0.0', '0.0', 'NGF7-15_IL1 -Decom. H60 - HOBID SAP2004_Slice 7_20131218_v1.xlsx', '2014-01-08 17:45:29.353000 +01:00:00', '2', '1')

    The table was created with:
    CREATE TABLE il1
    (
    measure text,
    wbs text NOT NULL,
    slice text,
    productvariant text,
    resp text,
    "dom-labour" double precision,
    licenses double precision,
    hobids double precision,
    total double precision,
    date timestamp without time zone,
    cw double precision NOT NULL,
    status double precision NOT NULL,
    filename character varying(100),
    CONSTRAINT "measure-per-cw" PRIMARY KEY (wbs, status, cw)
    )
    WITH (
    OIDS=FALSE
    );

    Any hints are welcome ;-)
    Cheers Alexander

  2. #2

    Default

    Just found the root cause after disabling the batch insert mode of the table output step.
    There was a duplicate record, so a duplicate key violition within the batch insert ...
    Sorry for this!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.