Revision 11362
Added by Aaron Marcuse-Kubitza about 11 years ago
lib/sh/local.sh | ||
---|---|---|
65 | 65 |
local dir="${dir:-$top_dir}" |
66 | 66 |
mk_schema_esc |
67 | 67 |
mk_table_esc |
68 |
local is_root="$(case "$USER" in *postgres) echo 1;; esac)" |
|
69 |
echo_vars is_root |
|
68 | 70 |
|
69 |
use_local
|
|
71 |
if test ! "$is_root"; then use_local; fi
|
|
70 | 72 |
(if test "$schema" -a "$table"; then cat <<EOF |
71 | 73 |
\cd $dir |
72 | 74 |
\set schema $schema_esc |
Also available in: Unified diff
bugfix: lib/sh/local.sh: psql(): don't default the connection vars using use_local if running as the postgres user. in that case, connection must happen via a socket, with server="", and as the user running the command (postgres), with user="".