Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0052441Openbravo ERPA. Platformpublic2023-05-12 20:512023-07-07 11:16
axelmercado 
jarmendariz 
urgentmajorhave not tried
closedfixed 
5
 
PR20Q4PR20Q4.5 
Core
No
0052441: install.source fails with "DROP DATABASE cannot be executed within a pipeline" with postgres latest minor releases
Latest minor releases for PostgreSQL for major versions 11,12,13,14,15 include a change causing install.source to always fail.

Specific PG versions including this change: 15.2, 14.7, 13.10, 12.14, and 11.19

Error message shown is:
<workspace>/src-db/database/build-create.xml:104: org.postgresql.util.PSQLException: ERROR: DROP DATABASE cannot be executed within a pipeline

Cause:
In issue 45385 we added code to workaround an incompatibility of Amazon RDS (compared to standard PostgreSQL).
Specifically adding an (optional) alter database owner change, just before the drop database.

Postgres change https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f48aa5df4e030ab75bdc2ca5fc480c4a830cf5f3 [^] [^]
now rejects some commands when being run in an already open transaction (and instead require an explicit commit)

This bug-report from another project is hit by the same change:
https://www.postgresql.org/message-id/4139340.1676050723%40sss.pgh.pa.us [^] [^]
discussion in there shows that is an intended behavior change (as that was just unsupported before, just not detected).

So looks like we need to workaround this on our side.

Note:
This issue is triggered even when database does not exist (so nothing to drop).
Just having the alter+drop in 1 transaction to be executed is enough to trigger the issue.
Basline: postgresql 11 or higher in latest minor version (at least the ones specified above)
ant install.source

Observe it failing with error message specified above.
No tags attached.
blocks defect 0051718 closed shuehner install.source fails with "DROP DATABASE cannot be executed within a pipeline" with postgres latest minor releases 
Issue History
2023-05-12 20:51axelmercadoNew Issue
2023-05-12 20:51axelmercadoAssigned To => Triage Platform Base
2023-05-12 20:51axelmercadoModules => Core
2023-05-12 20:51axelmercadoTriggers an Emergency Pack => No
2023-05-12 20:52axelmercadoRelationship addedblocks 0051718
2023-07-05 08:44hgbotNote Added: 0152117
2023-07-05 08:46jarmendarizAssigned ToTriage Platform Base => jarmendariz
2023-07-05 08:46jarmendarizStatusnew => scheduled
2023-07-07 11:16hgbotResolutionopen => fixed
2023-07-07 11:16hgbotStatusscheduled => closed
2023-07-07 11:16hgbotFixed in Version => PR20Q4.5
2023-07-07 11:16hgbotNote Added: 0152189
2023-07-07 11:16hgbotNote Added: 0152190

Notes
(0152117)
hgbot   
2023-07-05 08:44   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/931 [^]
(0152189)
hgbot   
2023-07-07 11:16   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 5fb0d3c86f023362b546a27744872d0bd5b17591
Author: Javier Armendáriz <javier.armendariz@openbravo.com>
Date: 05-07-2023 08:43:57
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/5fb0d3c86f023362b546a27744872d0bd5b17591 [^]

Fixed ISSUE-52441: Fix create.database with latest PG minor releases

---
M src-db/database/build-create.xml
---
(0152190)
hgbot   
2023-07-07 11:16   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/931 [^]