From aa6fdd186cf2c29e04d3cc8ca19783fb904a5a33 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 28 Mar 2011 22:52:23 +0300 Subject: [PATCH] Make duplicate_oids return nonzero exit status if duplicates were found Automatic detection of errors is easier that way. --- src/include/catalog/duplicate_oids | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.40.0