Re: Fwd: problems changing postgres jdbc driver

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Silvio Brandani *EXTERN*'" <silvio(dot)brandani(at)tech(dot)sdb(dot)it>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Fwd: problems changing postgres jdbc driver
Date: 2016-03-09 11:14:13
Message-ID: A737B7A37273E048B164557ADEF4A58B53809E59@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-odbc

Silvio Brandani wrote:
> We have problems changing postgres jdbc driver from postgresql-9.3-1102.jdbc41.jar to postgresql-
> 9.4.1208.jar
>
> we have table ap_invoice_t
>
> Referenced by:
> TABLE "ap_invoice_m" CONSTRAINT "ap_invoice_m_fkey" FOREIGN KEY (branch_cod, orig_doc, doc_year,
> azienda) REFERENCES "123".ap_invoice_t(branch_cod, orig_doc, doc_year, azienda) ON DELETE CASCADE
>
> the following operations are executed in order:

[...]

> INSERT INTO ap_invoice_t (branch_cod, doc_year, orig_doc, [...] azienda)
> values
> ($1, $2, $3, [...] $40)
>
> $1 = '2150100078', $2 = '2015', $3 = '0000079369', [...] $40 = 'CX'
>
>
> INSERT INTO ap_invoice_m (branch_cod, cod_voce, doc_year, orig_doc, progr, des_voce, imp_voce,
> azienda) values ($1, $2, $3, $4, $5, $6, $7, $8)
> DETAIL: parameters: $1 = '2150100078', $2 = 'M01', $3 = '2015', $4 = '0000079369', $5 = '1', $6 =
> 'OCEAN IMPORT FREIGHT', $7 = '150', $8 = 'CX'
> ERROR: insert or update on table "ap_invoice_m" violates foreign key constraint "ap_invoice_m_fkey"
> DETAIL: Key (branch_cod, orig_doc, doc_year, azienda)=(2150100078 , 0000079369 , 2015, CX ) is not
> present in table "ap_invoice_t".
> STATEMENT: INSERT INTO ap_invoice_m (branch_cod, cod_voce, doc_year, orig_doc, progr, des_voce,
> imp_voce, azienda) values ($1, $2, $3, $4, $5, $6, $7, $8)
>
> as you se we get unexpectedly Foreing key violation

Turn on server logging (log_statement=all) in postgresql.conf and examine the
server log:

- Are the two statements executed in the correct order?
- Are statements executed on the same database connection (same session ID in the log)?

It does not look like a JDBC driver problem at first glace.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Silvio Brandani 2016-03-09 11:29:18 Re: Fwd: problems changing postgres jdbc driver
Previous Message Silvio Brandani 2016-03-09 10:48:04 Fwd: problems changing postgres jdbc driver

Browse pgsql-odbc by date

  From Date Subject
Next Message Silvio Brandani 2016-03-09 11:29:18 Re: Fwd: problems changing postgres jdbc driver
Previous Message Silvio Brandani 2016-03-09 10:48:04 Fwd: problems changing postgres jdbc driver