From 53b4372910f5918770ca38c0b5a0c14c7f1068e8 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Wed, 9 Dec 2009 21:19:16 +0000 Subject: [PATCH] BF[2911533] - Set Postgre DB Search Path https://sourceforge.net/tracker/?func=detail&aid=2911533&group_id=176962&atid=879332 Fixed Windows DBRestore.bat file --- utils/postgresql/DBRestore.bat | 11 ++++++----- utils/postgresql/DBRestore.sh | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/postgresql/DBRestore.bat b/utils/postgresql/DBRestore.bat index 6d8f81be20..5e932927b5 100644 --- a/utils/postgresql/DBRestore.bat +++ b/utils/postgresql/DBRestore.bat @@ -1,8 +1,6 @@ -@Echo Adempiere Database Import $Revision: 1.3 $ +@Echo ADempiere Database Import -@Rem $Id: ImportAdempiere.bat,v 1.3 2005/01/22 21:59:15 jjanke Exp $ - -@Echo Importing Adempiere DB from %ADEMPIERE_HOME%\data\ExpDat.dmp (%ADEMPIERE_DB_NAME%) +@Echo Importing ADempiere DB from %ADEMPIERE_HOME%\data\ExpDat.dmp (%ADEMPIERE_DB_NAME%) @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment @@ -31,13 +29,16 @@ @echo Import Adempiere_pg.dmp @echo ------------------------------------- @psql -h %ADEMPIERE_DB_SERVER% -p %ADEMPIERE_DB_PORT% -d %ADEMPIERE_DB_NAME% -U %2 -c "drop schema sqlj cascade" +@set ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE %2 SET search_path TO adempiere, pg_catalog" +@psql -h %ADEMPIERE_DB_SERVER% -p %ADEMPIERE_DB_PORT% -d %ADEMPIERE_DB_NAME% -U %2 -c "%ADEMPIERE_ALTER_ROLE_SQL%" @psql -h %ADEMPIERE_DB_SERVER% -p %ADEMPIERE_DB_PORT% -d %ADEMPIERE_DB_NAME% -U %2 -f %ADEMPIERE_HOME%/data/ExpDat.dmp +@set ADEMPIERE_ALTER_ROLE_SQL= @set PGPASSWORD= @goto end :environment -@Echo Please make sure that the enviroment variables are set correctly: +@Echo Please make sure that the environment variables are set correctly: @Echo ADEMPIERE_HOME e.g. D:\ADEMPIERE2 @Echo ADEMPIERE_DB_NAME e.g. adempiere or xe @Echo ADEMPIERE_DB_SERVER e.g. dbserver.adempiere.org diff --git a/utils/postgresql/DBRestore.sh b/utils/postgresql/DBRestore.sh index 5a36689888..d772cdb65c 100644 --- a/utils/postgresql/DBRestore.sh +++ b/utils/postgresql/DBRestore.sh @@ -1,9 +1,8 @@ #!/bin/sh -# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $ -echo ADempiere Database Import $Revision: 1.10 $ +echo ADempiere Database Import -echo Importing Adempiere DB from $ADEMPIERE_HOME/data/ExpDat.dmp +echo Importing ADempiere DB from $ADEMPIERE_HOME/data/ExpDat.dmp if [ $# -le 2 ] then