Project

General

Profile

« Previous | Next » 

Revision 10295

lib/sh/db.sh: psql(): display stack traces and DETAIL sections of error messages at verbosity 2+, to help debugging (previously they were always turned off). in particular, the DETAIL section of a "duplicate key value violates unique constraint" error is useful because it contains the duplicated key.

View differences:

db.sh
248 248
	if can_log; then set -- --echo-all --echo-hidden "$@"; fi
249 249
	local redirs=("${redirs[@]}" '40<&0' "0<${stdin:-&20}" '41>&1')
250 250
	(
251
		# hide stack traces/DETAIL sections of error messages at verbosity <2
252
		if ! clog++ can_log; then echo '\set VERBOSITY terse'; fi
251 253
		if can_log; then cat <<'EOF'
252 254
\timing on
253
\set VERBOSITY terse
254 255
SET client_min_messages = NOTICE;
255 256
EOF
256 257
		fi

Also available in: Unified diff