Project

General

Profile

« Previous | Next » 

Revision 12740

lib/sh/db.sh: psql(): $verbose_ok: renamed to $bypass_ok for clarity, because this applies only to the `--output /dev/fd/41` bypass (which when not possible, requires turning off verbose output

View differences:

trunk/lib/sh/db.sh
275 275
# "Permission denied" error when running as sudo on Linux
276 276
{
277 277
	echo_func; kw_params stdin output_data
278
	local verbose_ok="$(! isset SUDO_USER; exit2bool)"; echo_vars verbose_ok
279
	local verbose_="$(test "$verbose_ok" && can_log; exit2bool)"
278
	local bypass_ok="$(! isset SUDO_USER; exit2bool)"; echo_vars bypass_ok
279
	local verbose_="$(test "$bypass_ok" && can_log; exit2bool)"
280 280
		echo_vars verbose_
281
	local data_bypasses_filter="$(test "$output_data" -a "$verbose_ok";
281
	local data_bypasses_filter="$(test "$output_data" -a "$bypass_ok";
282 282
		exit2bool)"; echo_vars data_bypasses_filter
283 283
	
284 284
	if test "$verbose_"; then set -- --echo-all --echo-hidden "$@"; fi
......
290 290
		echo "SET client_min_messages = \
291 291
$(if test "$verbose_"; then echo NOTICE; else echo WARNING; fi);"
292 292
		cat
293
	)|cmd_log_fd=${verbose_ok:+1} pg_cmd --file /dev/fd/40 \
293
	)|cmd_log_fd=${bypass_ok:+1} pg_cmd --file /dev/fd/40 \
294 294
${data_bypasses_filter:+--output /dev/fd/41 }--set ON_ERROR_STOP=1 --quiet "$@"\
295 295
|| verbosity_min=2 die_error_hidden
296 296
		# --output is for query *results*, not echoed statements

Also available in: Unified diff