gnumed-bugs
[Top][All Lists]
Advanced

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

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


From: Busser, Jim
Subject: [Gnumed-bugs] tweak request to gm-adjust_db_settings.sh
Date: Sat, 24 Jan 2015 07:11:50 +0000

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


reply via email to

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