Temporary workaround to `domtool-postgres' script
authorclinton_admin <clinton_admin@deleuze.hcoop.net>
Mon, 4 Oct 2010 04:21:30 +0000 (00:21 -0400)
committerclinton_admin <clinton_admin@deleuze.hcoop.net>
Mon, 4 Oct 2010 04:21:30 +0000 (00:21 -0400)
* Explicitly connect to `postgres' host until fritz has a slave
  installed and databases can be managed by slavesÃ

src/plugins/domtool-postgres

index 35fbc90..d05999f 100755 (executable)
@@ -4,8 +4,8 @@ case $1 in
        adduser)
                USERNAME=$2
 
-               sudo -u postgres psql -c "CREATE USER $USERNAME" template1
-               sudo -u postgres psql -c "ALTER TABLESPACE user_$USERNAME OWNER TO $USERNAME"
+               sudo -u postgres psql -h postgres -c "CREATE USER $USERNAME" template1
+               sudo -u postgres psql -h postgres -c "ALTER TABLESPACE user_$USERNAME OWNER TO $USERNAME"
        ;;
 
        createdb)
@@ -18,7 +18,7 @@ case $1 in
                    ENCODING="-E $ENCODING"
                fi
 
-               sudo -u postgres createdb -O $USERNAME -D user_$USERNAME $ENCODING $DBNAME
+               sudo -u postgres createdb -h postgres -O $USERNAME -D user_$USERNAME $ENCODING $DBNAME
        ;;
 
        dropdb)
@@ -26,7 +26,7 @@ case $1 in
                DBNAME_BASE=$3
                DBNAME="${USERNAME}_${DBNAME_BASE}"
 
-               sudo -u postgres dropdb $DBNAME
+               sudo -u postgres dropdb -h postgres $DBNAME
        ;;
 
        *)