OSDN Git Service
(root)
/
pg-rex
/
syncrep.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb51af7
)
Make duplicate_oids return nonzero exit status if duplicates were found
author
Peter Eisentraut
<peter_e@gmx.net>
Mon, 28 Mar 2011 19:52:23 +0000
(22:52 +0300)
committer
Peter Eisentraut
<peter_e@gmx.net>
Mon, 28 Mar 2011 19:56:52 +0000
(22:56 +0300)
Automatic detection of errors is easier that way.
src/include/catalog/duplicate_oids
patch
|
blob
|
history
diff --git
a/src/include/catalog/duplicate_oids
b/src/include/catalog/duplicate_oids
index
3f3d9f6
..
82c12f3
100755
(executable)
--- 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