Project

General

Profile

« Previous | Next » 

Revision 11353

bugfix: lib/sh/local.sh: pg_as_root(): need to use -E (preserve environment) option to sudo, so that $schema, $table get passed through

View differences:

db.sh
263 263
alias pg_cmd='"pg_cmd" "${FUNCNAME%%__*}"'
264 264

  
265 265
pg_as_root() # usage: pg_as_root {psql|pg_*} ... # only works inside runscript
266
{ echo_func; : "${wrap_fn?}"; sudo -u postgres "$wrap_fn" "$@"; }
266
{ echo_func; : "${wrap_fn?}"; sudo -E -u postgres "$wrap_fn" "$@"; }
267 267

  
268 268
fi # load new aliases
269 269
if self_being_included; then

Also available in: Unified diff