pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
problems changing postgres jdbc driver
10+ messages / 4 participants
[nested] [flat]

* problems changing postgres jdbc driver
@ 2016-03-09 10:46  Silvio Brandani <silvio.brandani@tech.sdb.it>
  0 siblings, 2 replies; 10+ messages in thread

From: Silvio Brandani @ 2016-03-09 10:46 UTC (permalink / raw)
  To: pgsql-odbc@postgresql.org; hiroshi@winpg.jp

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:

DELETE FROM ap_invoice_t WHERE branch_cod = '2150100078' and doc_year = 
'2015' and orig_doc = '0000079369'and azienda='CX';
--'2150100078', $2 = '2015', $3 = '0000079369'

DELETE FROM ap_invoice_m WHERE branch_cod = '2150100078' and doc_year = 
'2015' and orig_doc = '0000079369'and azienda='CX';

INSERT INTO ap_invoice_t (branch_cod, doc_year, orig_doc, amount, 
az_remota, branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam, 
cage1, cage2,
cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3, data_manut, data_par, 
dept, descr, doc_date, doc_type, esito, file_ref, house_bl, lcl_fcl,
loc_destin, master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca, 
targa, valuta, vettore, azienda)
values
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, 
$17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, 
$31, $32, $33, $34, $35, $36, $37, $38, $39, $40)

$1 = '2150100078', $2 = '2015', $3 = '0000079369', $4 = '150', $5 = 
'60', $6 = '19 MAYIS CAD. GOLDEN PLAZA NO : 3 KAT : 2', $7 = 'SISLI, 
ISTANBUL 34360', $8 = 'Tel. +90 212 395 1440', $9 = 'Fax. +90 212 355 
3505', $10 = 'SAVINO DEL BENE NAKLIYAT A.S. ISTANBUL', $11 = '', $12 = 
'', $13 = '', $14 = 'SALAR PREFAB', $15 = 'KOYA MAIN STREET', $16 = ' ', 
$17 = 'DI IORIO SPA', $18 = 'ZONA INDUSTRIALE IL GIARDINO', $19 = ' 
S.ELENA SANNITA', $20 = '2016-03-08 00:00:00', $21 = '2016-03-08', $22 = 
'03', $23 = 'FURNITURE', $24 = '2015-12-11', $25 = 'DB', $26 = 'Y', $27 
= 'XXXXCX', $28 = 'SDB01S106320', $29 = 'F', $30 = '', $31 = 
'ARKAOI0000000658', $32 = '000001407', $33 = ' ARKU841046/6 Supplier 
Inv.: 981/01,979/01 ', $34 = 'O50686', $35 = 'ANCONA', $36 = 'MERSIN', 
$37 = NULL, $38 = 'USD', $39 = 'TA', $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 
constrain*t "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


Please advise

-- 

Silvio Brandani




--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Fwd: problems changing postgres jdbc driver
@ 2016-03-09 10:48  Silvio Brandani <silvio.brandani@tech.sdb.it>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  1 sibling, 1 reply; 10+ messages in thread

From: Silvio Brandani @ 2016-03-09 10:48 UTC (permalink / raw)
  To: pgsql-jdbc



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:

DELETE FROM ap_invoice_t WHERE branch_cod = '2150100078' and doc_year = 
'2015' and orig_doc = '0000079369'and azienda='CX';
--'2150100078', $2 = '2015', $3 = '0000079369'

DELETE FROM ap_invoice_m WHERE branch_cod = '2150100078' and doc_year = 
'2015' and orig_doc = '0000079369'and azienda='CX';

INSERT INTO ap_invoice_t (branch_cod, doc_year, orig_doc, amount, 
az_remota, branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam, 
cage1, cage2,
cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3, data_manut, data_par, 
dept, descr, doc_date, doc_type, esito, file_ref, house_bl, lcl_fcl,
loc_destin, master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca, 
targa, valuta, vettore, azienda)
values
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, 
$17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, 
$31, $32, $33, $34, $35, $36, $37, $38, $39, $40)

$1 = '2150100078', $2 = '2015', $3 = '0000079369', $4 = '150', $5 = 
'60', $6 = '19 MAYIS CAD. GOLDEN PLAZA NO : 3 KAT : 2', $7 = 'SISLI, 
ISTANBUL 34360', $8 = 'Tel. +90 212 395 1440', $9 = 'Fax. +90 212 355 
3505', $10 = 'SAVINO DEL BENE NAKLIYAT A.S. ISTANBUL', $11 = '', $12 = 
'', $13 = '', $14 = 'SALAR PREFAB', $15 = 'KOYA MAIN STREET', $16 = ' ', 
$17 = 'DI IORIO SPA', $18 = 'ZONA INDUSTRIALE IL GIARDINO', $19 = ' 
S.ELENA SANNITA', $20 = '2016-03-08 00:00:00', $21 = '2016-03-08', $22 = 
'03', $23 = 'FURNITURE', $24 = '2015-12-11', $25 = 'DB', $26 = 'Y', $27 
= 'XXXXCX', $28 = 'SDB01S106320', $29 = 'F', $30 = '', $31 = 
'ARKAOI0000000658', $32 = '000001407', $33 = ' ARKU841046/6 Supplier 
Inv.: 981/01,979/01 ', $34 = 'O50686', $35 = 'ANCONA', $36 = 'MERSIN', 
$37 = NULL, $38 = 'USD', $39 = 'TA', $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 
constrain*t "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


Please advise

-- 

Silvio Brandani






--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 11:14  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  0 siblings, 1 reply; 10+ messages in thread

From: Albe Laurenz @ 2016-03-09 11:14 UTC (permalink / raw)
  To: 'Silvio Brandani *EXTERN*' <silvio.brandani@tech.sdb.it>; pgsql-jdbc

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

-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 11:29  Silvio Brandani <silvio.brandani@tech.sdb.it>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 2 replies; 10+ messages in thread

From: Silvio Brandani @ 2016-03-09 11:29 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; pgsql-jdbc

yes the,

previous log is from server logging , the statements are executed in 
that order and from same session, I clean up the log to be readble.

anyway the log is as follow ( session 22302)

2016-03-08 13:45:10 CET [22302]: [2038-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  
execute S_11: INSERT INTO ap_invoice_t (branch_cod, doc_year, orig_doc, 
amount, az_remota, branch_ad2, branch_ad3, branch_ad4, branch_ad5, 
branch_nam, cage1, cage2, cage3, cdes1, cdes2, cdes3, cfab1, cfab2, 
cfab3, data_manut, data_par, dept, descr, doc_date, doc_type, esito, 
file_ref, house_bl, lcl_fcl, loc_destin, master_bl, mov_nr, notes, 
orig_ref, porto_car, porto_sca, targa, valuta, vettore, azienda) values 
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, 
$17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, 
$31, $32, $33, $34, $35, $36, $37, $38, $39, $40)
2016-03-08 13:45:10 CET [22302]: [2039-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 
DETAIL:  parameters: $1 = '2160100121', $2 = '2016', $3 = '0010044846', 
$4 = '69.0999999999999943', $5 = '31', $6 = 'Via Del Botteghino, 24/26', 
$7 = 'SCANDICCI - FLORENCE 50018', $8 = 'Tel. +39 05552191', $9 = 'Fax. 
+39 055721288', $10 = 'SAVINO DEL BENE SPA WW-HQ - ITALY', $11 = '', $12 
= '', $13 = '', $14 = '', $15 = '', $16 = ' ', $17 = '', $18 = '', $19 = 
' ', $20 = '2016-03-08 00:00:00', $21 = '2016-03-08', $22 = '05', $23 = 
'', $24 = '2016-03-07', $25 = 'DB', $26 = 'Y', $27 = 'XXXXCZ', $28 = '', 
$29 = '', $30 = '', $31 = '', $32 = '000001733', $33 = '', $34 = '', $35 
= '', $36 = '', $37 = '', $38 = 'USD', $39 = '', $40 = 'CZ'
2016-03-08 13:45:10 CET [22302]: [2040-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  
duration: 2.661 ms
2016-03-08 13:45:10 CET [22302]: [2041-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  
duration: 0.176 ms
2016-03-08 13:45:10 CET [22302]: [2042-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  
duration: 0.206 ms
2016-03-08 13:45:10 CET [22302]: [2043-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  
execute <unnamed>: 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)
2016-03-08 13:45:10 CET [22302]: [2044-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 
DETAIL:  parameters: $1 = '2160100121', $2 = 'c03', $3 = '2016', $4 = 
'0010044846', $5 = '1', $6 = 'AS PER AGREEMENT TOTAL TO YOUR DEBIT FOR 
INTERNAL', $7 = '69.0999999999999943', $8 = 'CZ'
2016-03-08 13:45:10 CET [22302]: [2045-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 
ERROR:  insert or update on table "ap_invoice_m" violates foreign key 
constraint "ap_invoice_m_fkey"
2016-03-08 13:45:10 CET [22302]: [2046-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 
DETAIL:  Key (branch_cod, orig_doc, doc_year, azienda)=(2160100121 , 
0010044846 , 2016, CZ ) is not present in table "ap_invoice_t".
2016-03-08 13:45:10 CET [22302]: [2047-1] 
db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 
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)

Thanks

-- 

Silvio Brandani


Il 09/03/2016 12:14, Albe Laurenz ha scritto:
> 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



--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 13:04  Dave Cramer <pg@fastcrypt.com>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  1 sibling, 1 reply; 10+ messages in thread

From: Dave Cramer @ 2016-03-09 13:04 UTC (permalink / raw)
  To: Silvio Brandani <silvio.brandani@tech.sdb.it>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; pgsql-jdbc

The driver does not change the order of operations.

I'd be curious what else changed at the same time as the driver upgrade.

Either way if you could provide us with a test case we'd be happy to look
into it for you.

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 9 March 2016 at 06:29, Silvio Brandani <silvio.brandani@tech.sdb.it>
wrote:

> yes the,
>
> previous log is from server logging , the statements are executed in that
> order and from same session, I clean up the log to be readble.
>
> anyway the log is as follow ( session 22302)
>
> 2016-03-08 13:45:10 CET [22302]: [2038-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  execute S_11: INSERT INTO
> ap_invoice_t (branch_cod, doc_year, orig_doc, amount, az_remota,
> branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam, cage1, cage2,
> cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3, data_manut, data_par,
> dept, descr, doc_date, doc_type, esito, file_ref, house_bl, lcl_fcl,
> loc_destin, master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca,
> targa, valuta, vettore, azienda) values ($1, $2, $3, $4, $5, $6, $7, $8,
> $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23,
> $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38,
> $39, $40)
> 2016-03-08 13:45:10 CET [22302]: [2039-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  parameters: $1 =
> '2160100121', $2 = '2016', $3 = '0010044846', $4 = '69.0999999999999943',
> $5 = '31', $6 = 'Via Del Botteghino, 24/26', $7 = 'SCANDICCI - FLORENCE
> 50018', $8 = 'Tel. +39 05552191', $9 = 'Fax. +39 055721288', $10 = 'SAVINO
> DEL BENE SPA WW-HQ - ITALY', $11 = '', $12 = '', $13 = '', $14 = '', $15 =
> '', $16 = ' ', $17 = '', $18 = '', $19 = ' ', $20 = '2016-03-08 00:00:00',
> $21 = '2016-03-08', $22 = '05', $23 = '', $24 = '2016-03-07', $25 = 'DB',
> $26 = 'Y', $27 = 'XXXXCZ', $28 = '', $29 = '', $30 = '', $31 = '', $32 =
> '000001733', $33 = '', $34 = '', $35 = '', $36 = '', $37 = '', $38 = 'USD',
> $39 = '', $40 = 'CZ'
> 2016-03-08 13:45:10 CET [22302]: [2040-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 2.661 ms
> 2016-03-08 13:45:10 CET [22302]: [2041-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 0.176 ms
> 2016-03-08 13:45:10 CET [22302]: [2042-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 0.206 ms
> 2016-03-08 13:45:10 CET [22302]: [2043-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  execute <unnamed>: 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)
> 2016-03-08 13:45:10 CET [22302]: [2044-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  parameters: $1 =
> '2160100121', $2 = 'c03', $3 = '2016', $4 = '0010044846', $5 = '1', $6 =
> 'AS PER AGREEMENT TOTAL TO YOUR DEBIT FOR INTERNAL', $7 =
> '69.0999999999999943', $8 = 'CZ'
> 2016-03-08 13:45:10 CET [22302]: [2045-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it ERROR:  insert or update on
> table "ap_invoice_m" violates foreign key constraint "ap_invoice_m_fkey"
> 2016-03-08 13:45:10 CET [22302]: [2046-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  Key (branch_cod,
> orig_doc, doc_year, azienda)=(2160100121 , 0010044846 , 2016, CZ ) is not
> present in table "ap_invoice_t".
> 2016-03-08 13:45:10 CET [22302]: [2047-1] db=tsdb,user=java,lhost=
> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 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)
>
> Thanks
>
> --
>
> Silvio Brandani
>
> Il 09/03/2016 12:14, Albe Laurenz ha scritto:
>
> 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
>
>
>
> This message is for the recipients only. If you receive it in error,
> please notify the sender and delete it together with any attachments. For
> any further information, including our privacy policy please refer to
> http://www.savinodelbene.com/privacy/
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 13:16  Silvio Brandani <silvio.brandani@tech.sdb.it>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Silvio Brandani @ 2016-03-09 13:16 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; pgsql-jdbc

I don't say the driver change the order of operations, I said that after 
changing the driver the operations executed in that order give the 
Foreign key violation error.

But the record is inserted in ap_invoice_t (referenced by ap_invoice_m) 
one step before the insert on ap_invoice_m ( which raise the FK violaton 
error)

are there options  enable by default with the new driver they were not 
before ?


-- 

Silvio Brandani



Il 09/03/2016 14:04, Dave Cramer ha scritto:
> The driver does not change the order of operations.
>
> I'd be curious what else changed at the same time as the driver upgrade.
>
> Either way if you could provide us with a test case we'd be happy to 
> look into it for you.
>
> Dave Cramer
>
> davec@postgresintl.com <mailto:davec@postgresintl.com>
> www.postgresintl.com <http://www.postgresintl.com;
>
> On 9 March 2016 at 06:29, Silvio Brandani <silvio.brandani@tech.sdb.it 
> <mailto:silvio.brandani@tech.sdb.it>> wrote:
>
>     yes the,
>
>     previous log is from server logging , the statements are executed
>     in that order and from same session, I clean up the log to be readble.
>
>     anyway the log is as follow ( session 22302)
>
>     2016-03-08 13:45:10 CET [22302]: [2038-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; LOG:  execute S_11: INSERT INTO
>     ap_invoice_t (branch_cod, doc_year, orig_doc, amount, az_remota,
>     branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam, cage1,
>     cage2, cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3,
>     data_manut, data_par, dept, descr, doc_date, doc_type, esito,
>     file_ref, house_bl, lcl_fcl, loc_destin, master_bl, mov_nr, notes,
>     orig_ref, porto_car, porto_sca, targa, valuta, vettore, azienda)
>     values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13,
>     $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26,
>     $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40)
>     2016-03-08 13:45:10 CET [22302]: [2039-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; DETAIL:  parameters: $1 = '2160100121',
>     $2 = '2016', $3 = '0010044846', $4 = '69.0999999999999943', $5 =
>     '31', $6 = 'Via Del Botteghino, 24/26', $7 = 'SCANDICCI - FLORENCE
>     50018', $8 = 'Tel. +39 05552191', $9 = 'Fax. +39 055721288', $10 =
>     'SAVINO DEL BENE SPA WW-HQ - ITALY', $11 = '', $12 = '', $13 = '',
>     $14 = '', $15 = '', $16 = ' ', $17 = '', $18 = '', $19 = ' ', $20
>     = '2016-03-08 00:00:00', $21 = '2016-03-08', $22 = '05', $23 = '',
>     $24 = '2016-03-07', $25 = 'DB', $26 = 'Y', $27 = 'XXXXCZ', $28 =
>     '', $29 = '', $30 = '', $31 = '', $32 = '000001733', $33 = '', $34
>     = '', $35 = '', $36 = '', $37 = '', $38 = 'USD', $39 = '', $40 = 'CZ'
>     2016-03-08 13:45:10 CET [22302]: [2040-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; LOG:  duration: 2.661 ms
>     2016-03-08 13:45:10 CET [22302]: [2041-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; LOG:  duration: 0.176 ms
>     2016-03-08 13:45:10 CET [22302]: [2042-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; LOG:  duration: 0.206 ms
>     2016-03-08 13:45:10 CET [22302]: [2043-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; LOG:  execute <unnamed>: 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)
>     2016-03-08 13:45:10 CET [22302]: [2044-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; DETAIL:  parameters: $1 = '2160100121',
>     $2 = 'c03', $3 = '2016', $4 = '0010044846', $5 = '1', $6 = 'AS PER
>     AGREEMENT TOTAL TO YOUR DEBIT FOR INTERNAL', $7 =
>     '69.0999999999999943', $8 = 'CZ'
>     2016-03-08 13:45:10 CET [22302]: [2045-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; ERROR:  insert or update on table
>     "ap_invoice_m" violates foreign key constraint "ap_invoice_m_fkey"
>     2016-03-08 13:45:10 CET [22302]: [2046-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; DETAIL:  Key (branch_cod, orig_doc,
>     doc_year, azienda)=(2160100121 , 0010044846 , 2016, CZ ) is not
>     present in table "ap_invoice_t".
>     2016-03-08 13:45:10 CET [22302]: [2047-1]
>     db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>     <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>     <http://jblade01.sdb.it; 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)
>
>     Thanks
>
>     -- 
>
>     Silvio Brandani
>
>
>     Il 09/03/2016 12:14, Albe Laurenz ha scritto:
>>     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
>
>
>     This message is for the recipients only. If you receive it in
>     error, please notify the sender and delete it together with any
>     attachments. For any further information, including our privacy
>     policy please refer to http://www.savinodelbene.com/privacy/
>
>



--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 13:18  Dave Cramer <pg@fastcrypt.com>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  0 siblings, 1 reply; 10+ messages in thread

From: Dave Cramer @ 2016-03-09 13:18 UTC (permalink / raw)
  To: Silvio Brandani <silvio.brandani@tech.sdb.it>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; pgsql-jdbc

Oh, sorry for the mis-understanding.

Is it possible to create a test case which creates this error ?

Dave

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 9 March 2016 at 08:16, Silvio Brandani <silvio.brandani@tech.sdb.it>
wrote:

> I don't say the driver change the order of operations, I said that after
> changing the driver the operations executed in that order  give the Foreign
> key violation error.
>
> But the record is inserted in ap_invoice_t (referenced by ap_invoice_m)
> one step before the insert on ap_invoice_m ( which raise the FK violaton
> error)
>
> are there options  enable by default with the new driver they were not
> before ?
>
>
> --
>
> Silvio Brandani
>
>
> Il 09/03/2016 14:04, Dave Cramer ha scritto:
>
> The driver does not change the order of operations.
>
> I'd be curious what else changed at the same time as the driver upgrade.
>
> Either way if you could provide us with a test case we'd be happy to look
> into it for you.
>
> Dave Cramer
>
> davec@postgresintl.com
> www.postgresintl.com
>
> On 9 March 2016 at 06:29, Silvio Brandani <silvio.brandani@tech.sdb.it>
> wrote:
>
>> yes the,
>>
>> previous log is from server logging , the statements are executed in that
>> order and from same session, I clean up the log to be readble.
>>
>> anyway the log is as follow ( session 22302)
>>
>> 2016-03-08 13:45:10 CET [22302]: [2038-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  execute S_11: INSERT
>> INTO ap_invoice_t (branch_cod, doc_year, orig_doc, amount, az_remota,
>> branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam, cage1, cage2,
>> cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3, data_manut, data_par,
>> dept, descr, doc_date, doc_type, esito, file_ref, house_bl, lcl_fcl,
>> loc_destin, master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca,
>> targa, valuta, vettore, azienda) values ($1, $2, $3, $4, $5, $6, $7, $8,
>> $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23,
>> $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38,
>> $39, $40)
>> 2016-03-08 13:45:10 CET [22302]: [2039-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  parameters: $1 =
>> '2160100121', $2 = '2016', $3 = '0010044846', $4 = '69.0999999999999943',
>> $5 = '31', $6 = 'Via Del Botteghino, 24/26', $7 = 'SCANDICCI - FLORENCE
>> 50018', $8 = 'Tel. +39 05552191', $9 = 'Fax. +39 055721288', $10 = 'SAVINO
>> DEL BENE SPA WW-HQ - ITALY', $11 = '', $12 = '', $13 = '', $14 = '', $15 =
>> '', $16 = ' ', $17 = '', $18 = '', $19 = ' ', $20 = '2016-03-08 00:00:00',
>> $21 = '2016-03-08', $22 = '05', $23 = '', $24 = '2016-03-07', $25 = 'DB',
>> $26 = 'Y', $27 = 'XXXXCZ', $28 = '', $29 = '', $30 = '', $31 = '', $32 =
>> '000001733', $33 = '', $34 = '', $35 = '', $36 = '', $37 = '', $38 = 'USD',
>> $39 = '', $40 = 'CZ'
>> 2016-03-08 13:45:10 CET [22302]: [2040-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 2.661 ms
>> 2016-03-08 13:45:10 CET [22302]: [2041-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 0.176 ms
>> 2016-03-08 13:45:10 CET [22302]: [2042-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  duration: 0.206 ms
>> 2016-03-08 13:45:10 CET [22302]: [2043-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it LOG:  execute <unnamed>:
>> 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)
>> 2016-03-08 13:45:10 CET [22302]: [2044-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  parameters: $1 =
>> '2160100121', $2 = 'c03', $3 = '2016', $4 = '0010044846', $5 = '1', $6 =
>> 'AS PER AGREEMENT TOTAL TO YOUR DEBIT FOR INTERNAL', $7 =
>> '69.0999999999999943', $8 = 'CZ'
>> 2016-03-08 13:45:10 CET [22302]: [2045-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it ERROR:  insert or update on
>> table "ap_invoice_m" violates foreign key constraint "ap_invoice_m_fkey"
>> 2016-03-08 13:45:10 CET [22302]: [2046-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it DETAIL:  Key (branch_cod,
>> orig_doc, doc_year, azienda)=(2160100121 , 0010044846 , 2016, CZ ) is not
>> present in table "ap_invoice_t".
>> 2016-03-08 13:45:10 CET [22302]: [2047-1] db=tsdb,user=java,lhost=
>> sdbfi-pg02ng.sdb.it,rhost=jblade01.sdb.it 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)
>>
>> Thanks
>>
>> --
>>
>> Silvio Brandani
>>
>> Il 09/03/2016 12:14, Albe Laurenz ha scritto:
>>
>> 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
>>
>>
>>
>> This message is for the recipients only. If you receive it in error,
>> please notify the sender and delete it together with any attachments. For
>> any further information, including our privacy policy please refer to
>> http://www.savinodelbene.com/privacy/
>>
>>
>
>
> This message is for the recipients only. If you receive it in error,
> please notify the sender and delete it together with any attachments. For
> any further information, including our privacy policy please refer to
> http://www.savinodelbene.com/privacy/
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 13:19  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  1 sibling, 0 replies; 10+ messages in thread

From: Albe Laurenz @ 2016-03-09 13:19 UTC (permalink / raw)
  To: 'Silvio Brandani *EXTERN*' <silvio.brandani@tech.sdb.it>; pgsql-jdbc

Silvio Brandani wrote:
> previous log is from server logging , the statements are executed in that order and from same session,
> I clean up the log to be readble.

No idea...
Maybe there is something you cleaned up from the log that could give a clue.
Are there any triggers on either of the tables?

Yours,
Laurenz Albe

-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Fwd: problems changing postgres jdbc driver
@ 2016-03-09 13:59  Silvio Brandani <silvio.brandani@tech.sdb.it>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Silvio Brandani @ 2016-03-09 13:59 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; pgsql-jdbc


-- 

Silvio Brandani


good idea, we set up a test case.

we suspect something related to server prepared statement  .

Thanks

Il 09/03/2016 14:18, Dave Cramer ha scritto:
> Oh, sorry for the mis-understanding.
>
> Is it possible to create a test case which creates this error ?
>
> Dave
>
> Dave Cramer
>
> davec@postgresintl.com <mailto:davec@postgresintl.com>
> www.postgresintl.com <http://www.postgresintl.com;
>
> On 9 March 2016 at 08:16, Silvio Brandani <silvio.brandani@tech.sdb.it 
> <mailto:silvio.brandani@tech.sdb.it>> wrote:
>
>     I don't say the driver change the order of operations, I said that
>     after changing the driver the operations executed in that order
>     give the Foreign key violation error.
>
>     But the record is inserted in ap_invoice_t (referenced by
>     ap_invoice_m) one step before the insert on ap_invoice_m ( which
>     raise the FK violaton error)
>
>     are there options  enable by default with the new driver they were
>     not before ?
>
>
>     -- 
>
>     Silvio Brandani
>
>
>
>     Il 09/03/2016 14:04, Dave Cramer ha scritto:
>>     The driver does not change the order of operations.
>>
>>     I'd be curious what else changed at the same time as the driver
>>     upgrade.
>>
>>     Either way if you could provide us with a test case we'd be happy
>>     to look into it for you.
>>
>>     Dave Cramer
>>
>>     davec@postgresintl.com <mailto:davec@postgresintl.com>
>>     www.postgresintl.com <http://www.postgresintl.com;
>>
>>     On 9 March 2016 at 06:29, Silvio Brandani
>>     <silvio.brandani@tech.sdb.it
>>     <mailto:silvio.brandani@tech.sdb.it>> wrote:
>>
>>         yes the,
>>
>>         previous log is from server logging , the statements are
>>         executed in that order and from same session, I clean up the
>>         log to be readble.
>>
>>         anyway the log is as follow ( session 22302)
>>
>>         2016-03-08 13:45:10 CET [22302]: [2038-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; LOG: execute S_11: INSERT INTO
>>         ap_invoice_t (branch_cod, doc_year, orig_doc, amount,
>>         az_remota, branch_ad2, branch_ad3, branch_ad4, branch_ad5,
>>         branch_nam, cage1, cage2, cage3, cdes1, cdes2, cdes3, cfab1,
>>         cfab2, cfab3, data_manut, data_par, dept, descr, doc_date,
>>         doc_type, esito, file_ref, house_bl, lcl_fcl, loc_destin,
>>         master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca,
>>         targa, valuta, vettore, azienda) values ($1, $2, $3, $4, $5,
>>         $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18,
>>         $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30,
>>         $31, $32, $33, $34, $35, $36, $37, $38, $39, $40)
>>         2016-03-08 13:45:10 CET [22302]: [2039-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; DETAIL:  parameters: $1 =
>>         '2160100121', $2 = '2016', $3 = '0010044846', $4 =
>>         '69.0999999999999943', $5 = '31', $6 = 'Via Del Botteghino,
>>         24/26', $7 = 'SCANDICCI - FLORENCE 50018', $8 = 'Tel. +39
>>         05552191', $9 = 'Fax. +39 055721288', $10 = 'SAVINO DEL BENE
>>         SPA WW-HQ - ITALY', $11 = '', $12 = '', $13 = '', $14 = '',
>>         $15 = '', $16 = ' ', $17 = '', $18 = '', $19 = ' ', $20 =
>>         '2016-03-08 00:00:00', $21 = '2016-03-08', $22 = '05', $23 =
>>         '', $24 = '2016-03-07', $25 = 'DB', $26 = 'Y', $27 =
>>         'XXXXCZ', $28 = '', $29 = '', $30 = '', $31 = '', $32 =
>>         '000001733', $33 = '', $34 = '', $35 = '', $36 = '', $37 =
>>         '', $38 = 'USD', $39 = '', $40 = 'CZ'
>>         2016-03-08 13:45:10 CET [22302]: [2040-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; LOG: duration: 2.661 ms
>>         2016-03-08 13:45:10 CET [22302]: [2041-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; LOG: duration: 0.176 ms
>>         2016-03-08 13:45:10 CET [22302]: [2042-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; LOG: duration: 0.206 ms
>>         2016-03-08 13:45:10 CET [22302]: [2043-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; LOG: execute <unnamed>: 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)
>>         2016-03-08 13:45:10 CET [22302]: [2044-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; DETAIL:  parameters: $1 =
>>         '2160100121', $2 = 'c03', $3 = '2016', $4 = '0010044846', $5
>>         = '1', $6 = 'AS PER AGREEMENT TOTAL TO YOUR DEBIT FOR
>>         INTERNAL', $7 = '69.0999999999999943', $8 = 'CZ'
>>         2016-03-08 13:45:10 CET [22302]: [2045-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; ERROR:  insert or update on table
>>         "ap_invoice_m" violates foreign key constraint
>>         "ap_invoice_m_fkey"
>>         2016-03-08 13:45:10 CET [22302]: [2046-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; DETAIL:  Key (branch_cod, orig_doc,
>>         doc_year, azienda)=(2160100121 , 0010044846 , 2016, CZ ) is
>>         not present in table "ap_invoice_t".
>>         2016-03-08 13:45:10 CET [22302]: [2047-1]
>>         db=tsdb,user=java,lhost=sdbfi-pg02ng.sdb.it
>>         <http://sdbfi-pg02ng.sdb.it>,rhost=jblade01.sdb.it
>>         <http://jblade01.sdb.it; 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)
>>
>>         Thanks
>>
>>         -- 
>>
>>         Silvio Brandani
>>
>>
>>         Il 09/03/2016 12:14, Albe Laurenz ha scritto:
>>>         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
>>
>>
>>         This message is for the recipients only. If you receive it in
>>         error, please notify the sender and delete it together with
>>         any attachments. For any further information, including our
>>         privacy policy please refer to
>>         http://www.savinodelbene.com/privacy/
>>
>>
>
>
>     This message is for the recipients only. If you receive it in
>     error, please notify the sender and delete it together with any
>     attachments. For any further information, including our privacy
>     policy please refer to http://www.savinodelbene.com/privacy/
>
>



--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together with any attachments. For any further information, including our privacy policy please refer to http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: problems changing postgres jdbc driver
@ 2016-03-10 00:18  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Silvio Brandani <silvio.brandani@tech.sdb.it>
  1 sibling, 0 replies; 10+ messages in thread

From: Adrian Klaver @ 2016-03-10 00:18 UTC (permalink / raw)
  To: Silvio Brandani <silvio.brandani@tech.sdb.it>; pgsql-odbc@postgresql.org; hiroshi@winpg.jp

On 03/09/2016 02:46 AM, Silvio Brandani wrote:
> We have problems changing  postgres jdbc driver  from
> postgresql-9.3-1102.jdbc41.jar to postgresql-9.4.1208.jar

FYI this is the ODBC list. The JDBC list is here:

http://www.postgresql.org/list/pgsql-jdbc/

>
> 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:
>
> DELETE FROM ap_invoice_t WHERE branch_cod = '2150100078' and doc_year =
> '2015' and orig_doc = '0000079369'and azienda='CX';
> --'2150100078', $2 = '2015', $3 = '0000079369'
>
> DELETE FROM ap_invoice_m WHERE branch_cod = '2150100078' and doc_year =
> '2015' and orig_doc = '0000079369'and azienda='CX';
>
> INSERT INTO ap_invoice_t (branch_cod, doc_year, orig_doc, amount,
> az_remota, branch_ad2, branch_ad3, branch_ad4, branch_ad5, branch_nam,
> cage1, cage2,
> cage3, cdes1, cdes2, cdes3, cfab1, cfab2, cfab3, data_manut, data_par,
> dept, descr, doc_date, doc_type, esito, file_ref, house_bl, lcl_fcl,
> loc_destin, master_bl, mov_nr, notes, orig_ref, porto_car, porto_sca,
> targa, valuta, vettore, azienda)
> values
> ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16,
> $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30,
> $31, $32, $33, $34, $35, $36, $37, $38, $39, $40)
>
> $1 = '2150100078', $2 = '2015', $3 = '0000079369', $4 = '150', $5 =
> '60', $6 = '19 MAYIS CAD. GOLDEN PLAZA NO : 3 KAT : 2', $7 = 'SISLI,
> ISTANBUL 34360', $8 = 'Tel. +90 212 395 1440', $9 = 'Fax. +90 212 355
> 3505', $10 = 'SAVINO DEL BENE NAKLIYAT A.S. ISTANBUL', $11 = '', $12 =
> '', $13 = '', $14 = 'SALAR PREFAB', $15 = 'KOYA MAIN STREET', $16 = ' ',
> $17 = 'DI IORIO SPA', $18 = 'ZONA INDUSTRIALE IL GIARDINO', $19 = '
> S.ELENA SANNITA', $20 = '2016-03-08 00:00:00', $21 = '2016-03-08', $22 =
> '03', $23 = 'FURNITURE', $24 = '2015-12-11', $25 = 'DB', $26 = 'Y', $27
> = 'XXXXCX', $28 = 'SDB01S106320', $29 = 'F', $30 = '', $31 =
> 'ARKAOI0000000658', $32 = '000001407', $33 = ' ARKU841046/6 Supplier
> Inv.: 981/01,979/01 ', $34 = 'O50686', $35 = 'ANCONA', $36 = 'MERSIN',
> $37 = NULL, $38 = 'USD', $39 = 'TA', $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
> constrain*t "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
>
>
> Please advise
>
> --
>
> Silvio Brandani
>
>
>
> disclaimer-sdb
> This message is for the recipients only. If you receive it in error,
> please notify the sender and delete it together with any attachments.
> For any further information, including our privacy policy please refer
> to http://www.savinodelbene.com/privacy/
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2016-03-10 00:18 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09 10:46 problems changing postgres jdbc driver Silvio Brandani <silvio.brandani@tech.sdb.it>
2016-03-09 10:48 ` Silvio Brandani <silvio.brandani@tech.sdb.it>
2016-03-09 11:14   ` Albe Laurenz <laurenz.albe@wien.gv.at>
2016-03-09 11:29     ` Silvio Brandani <silvio.brandani@tech.sdb.it>
2016-03-09 13:04       ` Dave Cramer <pg@fastcrypt.com>
2016-03-09 13:16         ` Silvio Brandani <silvio.brandani@tech.sdb.it>
2016-03-09 13:18           ` Dave Cramer <pg@fastcrypt.com>
2016-03-09 13:59             ` Silvio Brandani <silvio.brandani@tech.sdb.it>
2016-03-09 13:19       ` Albe Laurenz <laurenz.albe@wien.gv.at>
2016-03-10 00:18 ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox