Code

pgtest.sh: 'setup': Create database for the current user.
authorSebastian Harl <sh@tokkee.org>
Sun, 14 Oct 2012 21:17:30 +0000 (23:17 +0200)
committerSebastian Harl <sh@tokkee.org>
Sun, 14 Oct 2012 21:17:30 +0000 (23:17 +0200)
… rather than using a hard-coded value.

pgtest.sh

index 692de5e610abdb27bb5c72b1d702241d560c9163..a22d93a279577ff53fb7408bb879ab4f4d033dbe 100755 (executable)
--- a/pgtest.sh
+++ b/pgtest.sh
@@ -58,7 +58,7 @@ case "$1" in
                sed -r -i -e "s/^#dynamic_library_path = '\\\$libdir'/dynamic_library_path = '\$libdir:$PWD_esc\/src'/" $TARGET/var/lib/postgresql/main/postgresql.conf
                sed -r -i -e "s/^#unix_socket_directory = ''/unix_socket_directory = '$TARGET_esc\/var\/run\/postgresql'/" $TARGET/var/lib/postgresql/main/postgresql.conf
                $0 start -B
-               $BIN_DIR/createdb -e -h $TARGET/var/run/postgresql/ -p 5435 tokkee
+               $BIN_DIR/createdb -e -h $TARGET/var/run/postgresql/ -p 5435 "$( id -un )"
                $0 stop
                ;;
        client)