=== modified file 'zsh-functions/confz_postgresql_init' --- zsh-functions/confz_postgresql_init 2014-06-28 04:56:42 +0000 +++ zsh-functions/confz_postgresql_init 2014-06-28 04:40:02 +0000 @@ -66,39 +66,6 @@ initdb="/usr/lib/postgresql-$vars[slot]/bin/initdb" } - -confz_postgresql_user_check() { - checkvars name - defvar user postgres - defvar psql psql - defvar createuser createuser - defvar allow_createdb 0 - defvar allow_createrole 0 - defvar allow_replication 0 - defvar allow_login 1 - defvar superuser 0 - - local -a opts - - opts+=( -U $vars[user] ) - (($+vars[host])) && opts+=( --host=$vars[host] ) - (($+vars[port])) && opts+=( --port=$vars[port] ) - - do_command=( $vars[createdb] $opts $vars[name] ) - - local flag - for flag in allow_createdb allow_createrole allow_replication allow_login superuser; do - if (($vars[$flag])); then - do_command+=( --${flag#allow_} ) - else - do_command+=( --no-${flag#allow_} ) - fi - done - - out=$( confz_do $vars[psql] $opts -AP tuples_only=on -c '\dg' ) || die "psql failed" - grep -q "^$vars[name]|" <<<$out -} - confz_postgresql_db_check() { checkvars db owner defvar user postgres