gnumed-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-bugs] tweak request to gm-adjust_db_settings.sh


From: Karsten Hilbert
Subject: Re: [Gnumed-bugs] tweak request to gm-adjust_db_settings.sh
Date: Sat, 24 Jan 2015 21:02:26 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

I have attached an improved file.

Karsten

On Sat, Jan 24, 2015 at 07:11:50AM +0000, Jim Busser wrote:

> Lines 16-19 say
> 
>     #==============================================================
>     # There really should not be any need to
>     # change anything below this line.
>     #==============================================================
> 
> however I ran into 
> 
>     ==> Creating database settings adjustment SQL script ...
>         /tmp/gnumed/gm-db-settings-3692.sql
>     -- server_encoding = UTF8
>     
>     ==> Adjusting settings of database gnumed_v20 ...
>         ERROR: failed to adjust database settings. Aborting.
>         LOG  : /tmp/gnumed/gm-adjust_db_settings.sh-3692.log
> 
> with the log containing two lines, the first likely harmless, the second not 
> ...
> 
>     could not change directory to "/tmp/gnumed-server.20.2/server": 
> Permission denied
>     psql: FATAL:  database "gnumed_v20" does not exist
> 
> which results from the fact that I have
> 
>       PostgreSQL 9.1 running on port 5432)
>       PostgreSQL 9.4 running on 5433
>       gnumed_v20 created in 9.4 therefore accessible via port 5433
> 
> and line 100 make no provision for a non-default port:
> 
>       sudo -u postgres psql -d ${TARGET_DB} -f ${SQL_FILE} &> ${LOG} 
> 
> I was able to overcome this by modifying the above line to
> 
>       sudo -u postgres psql -p 5433 -d ${TARGET_DB} -f ${SQL_FILE} &> ${LOG}
> 
> or, as root, declaring
> 
>       PGPORT=5433; export PGPORT
> 
> and inserting the sudo option -E (keep environment):
> 
>       sudo -E -u postgres -d ${TARGET_DB} -f ${SQL_FILE} &> ${LOG}
> 
> So… in case people like me did not go to the trouble of specifying a PGPORT 
> to load under every shell and user, shall we at least alter the comment in 
> lines 16-19 to
> 
>     #==============================================================
>     # There really should not be any need to change anything
>     # below this line unless psql must call a non-default port.
>     #==============================================================
> 
> -- Jim

-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

Attachment: gm-adjust_db_settings.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]