Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040317Openbravo ERPA. Platformpublic2019-03-05 13:552019-03-28 14:56
alostale 
alostale 
normalmajorhave not tried
closedfixed 
5
 
3.0PR19Q2 
caristu
Core
No
0040317: can't restore pg dump of a retail instance
Retail instances cannot be recovered with pg_restore.
0. Update a retail instance to a version including POS changest 8afc424cc7a4 [1]
1. pg_dump it
2. restore it with pg_restore

  ERROR:
   pg_restore: [archiver (db)] could not execute query: ERROR: function dateformat() does not exist
   LINE 1: SELECT to_timestamp(to_char($1, dateFormat()), dateFormat())
                                           ^
   HINT: No function matches the given name and argument types. You might need to add explicit type casts.
   QUERY: SELECT to_timestamp(to_char($1, dateFormat()), dateFormat())
   CONTEXT: PL/pgSQL function public.trunc(timestamp without time zone) line 3 at RETURN
       Command was: CREATE INDEX obpos_app_cashup_date_idx ON public.obpos_app_cashup USING btree (public.trunc(cashupdate));



[1] hg log -r 8afc424cc7a4 -p
changeset: 11001:8afc424cc7a4
user: Eduardo Argal Guibert <eduardo.argal@openbravo.com>
date: Wed Feb 27 18:43:19 2019 +0100
summary: Adds new index to OBPOS_APP_CASHUP for CASHUPDATE

diff -r ed15e5ff9b53 -r 8afc424cc7a4 src-db/database/model/tables/OBPOS_APP_CASHUP.xml
--- a/src-db/database/model/tables/OBPOS_APP_CASHUP.xml Wed Feb 27 13:18:39 2019 +0100
+++ b/src-db/database/model/tables/OBPOS_APP_CASHUP.xml Wed Feb 27 18:43:19 2019 +0100
@@ -112,6 +112,9 @@
       <foreign-key foreignTable="OBPOS_APP_CASHUP" name="OBPOS_APPCASH_PARENT">
         <reference local="OBPOS_PARENT_CASHUP_ID" foreign="OBPOS_APP_CASHUP_ID"/>
       </foreign-key>
+ <index name="OBPOS_APP_CASHUP_DATE_IDX" unique="false">
+ <index-column name="functionBasedColumn" functionExpression="TRUNC(CASHUPDATE)"/>
+ </index>
       <index name="OBPOS_APP_CASHUP_PARENT_IDX" unique="false">
         <index-column name="OBPOS_PARENT_CASHUP_ID"/>
         <whereClause><![CDATA[OBPOS_PARENT_CASHUP_ID IS NOT NULL]]></whereClause>
No tags attached.
related to defect 0038179 closed alostale cannot restore pg dump 
Issue History
2019-03-05 13:55alostaleNew Issue
2019-03-05 13:55alostaleAssigned To => platform
2019-03-05 13:55alostaleModules => Core
2019-03-05 13:55alostaleTriggers an Emergency Pack => No
2019-03-05 13:55alostaleRelationship addedrelated to 0038179
2019-03-05 13:55alostaleAssigned Toplatform => alostale
2019-03-05 13:59alostaleReview Assigned To => caristu
2019-03-05 14:01hgbotCheckin
2019-03-05 14:01hgbotNote Added: 0110231
2019-03-05 14:01hgbotStatusnew => resolved
2019-03-05 14:01hgbotResolutionopen => fixed
2019-03-05 14:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8b497714669eedb6476c9d6abedbc33a4012518e [^]
2019-03-08 13:36caristuNote Added: 0110322
2019-03-08 13:36caristuStatusresolved => closed
2019-03-08 13:36caristuFixed in Version => 3.0PR19Q2
2019-03-28 14:56hudsonbotCheckin
2019-03-28 14:56hudsonbotNote Added: 0110847

Notes
(0110231)
hgbot   
2019-03-05 14:01   
Repository: erp/devel/pi
Changeset: 8b497714669eedb6476c9d6abedbc33a4012518e
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Mar 05 13:58:17 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8b497714669eedb6476c9d6abedbc33a4012518e [^]

fixed bug 40317: can't restore pg dump of a retail instance

  Added search_path to trunc functions, which where missing in fix for 0038179.
  This is necessary to enable pg_restore when trunc is used in a contraint or
  index as it calls other functions not in pg_catalog schema.

---
M src-db/database/model/prescript-PostgreSql.sql
---
(0110322)
caristu   
2019-03-08 13:36   
Code reviewed + tested OK.
(0110847)
hudsonbot   
2019-03-28 14:56   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b2fbc1588df4 [^]
Maturity status: Test