Das sehe ich in PSQL-Logs:
2024-04-17 12:40:41.701 CEST [246485] postgres@db FEHLER: Müll folgt auf Parameter bei »$3O« bei Zeichen 1892
2024-04-17 12:40:41.701 CEST [246485] postgres@db ANWEISUNG: SELECT o.id AS orderitems_id,
c1.accno AS inventory_accno, c1.new_chart_id AS inventory_new_chart, date('10.01.2024') - c1.valid_from as inventory_valid,
c2.accno AS income_accno, c2.new_chart_id AS income_new_chart, date('10.01.2024') - c2.valid_from as income_valid,
c3.accno AS expense_accno, c3.new_chart_id AS expense_new_chart, date('10.01.2024') - c3.valid_from as expense_valid,
oe.ordnumber AS ordnumber_oe, oe.transdate AS transdate_oe, oe.cusordnumber AS cusordnumber_oe,
p.partnumber, p.part_type, p.listprice, o.description, o.qty,
p.classification_id,
o.sellprice, o.parts_id AS id, o.unit, o.discount, p.notes AS partnotes, p.part_type,
o.reqdate, o.project_id, o.serialnumber, o.ship, o.lastcost,
o.ordnumber, o.transdate, o.cusordnumber, o.subtotal, o.longdescription,
o.price_factor_id, o.price_factor, o.marge_price_factor, o.active_price_source, o.active_discount_source,
pr.projectnumber, p.formel,
pg.partsgroup, o.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=o.pricegroup_id) as pricegroup
FROM orderitems o
JOIN parts p ON (o.parts_id = p.id)
JOIN oe ON (o.trans_id = oe.id)
LEFT JOIN chart c1 ON ((SELECT inventory_accno_id FROM buchungsgruppen WHERE id=p.buchungsgruppen_id) = c1.id)
LEFT JOIN chart c2 ON ((SELECT tc.income_accno_id FROM taxzone_charts tc WHERE tc.taxzone_id = $1 and tc.buchungsgruppen_id = p.buchungsgruppen_id) = c2.id)
LEFT JOIN chart c3 ON ((SELECT tc.expense_accno_id FROM taxzone_charts tc WHERE tc.taxzone_id = $2 and tc.buchungsgruppen_id = p.buchungsgruppen_id) = c3.id)
LEFT JOIN project pr ON (o.project_id = pr.id)
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) WHERE o.trans_id = $3ORDER BY o.trans_id, o.position
Anscheinend ist das Problem hier: "$3ORDER BY", was vllt. "$3 ORDER BY" sein sollte.
Die Version des DB-Server ist leider ungleich. Auf dem alten Server:
~$ apt list postgresql
Auflistung… Fertig
postgresql/oldstable,now 13+225+deb11u1 all [installiert]
und auf dem neuen:
~# apt list postgresql
Auflistung… Fertig
postgresql/stable,now 15+248 all [installiert]
Ich habe aber gelesen, dass die Rückwartskompatibilität zwischen den 2 in Ordnung sein sollte.