From: Peter Eisentraut Date: Mon, 28 Mar 2011 19:52:23 +0000 (+0300) Subject: Make duplicate_oids return nonzero exit status if duplicates were found X-Git-Tag: REL9_1_BETA1~193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa6fdd186cf2c29e04d3cc8ca19783fb904a5a33;p=postgresql Make duplicate_oids return nonzero exit status if duplicates were found Automatic detection of errors is easier that way. --- diff --git a/src/include/catalog/duplicate_oids b/src/include/catalog/duplicate_oids index 3f3d9f69a8..82c12f3afc 100755 --- a/src/include/catalog/duplicate_oids +++ b/src/include/catalog/duplicate_oids @@ -22,6 +22,9 @@ sed -n -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \ -e 's/^DECLARE_TOAST([^,]*, *\([0-9][0-9]*\), *\([0-9][0-9]*\).*$/\1,\2/p' | \ tr ',' '\n' | \ sort -n | \ -uniq -d +uniq -d | \ +grep '.' -exit 0 +# nonzero exit code if lines were produced +[ $? -eq 1 ] +exit