We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 65fceaf + 6b27472 commit 46f6e8cCopy full SHA for 46f6e8c
1 file changed
pg_sample
@@ -211,6 +211,8 @@ $SIG{TERM} = $SIG{INT} = $SIG{QUIT} = $SIG{HUP} = sub {
211
die "Received signal '$signal'; cleaning up and terminating.\n";
212
};
213
214
+$SIG{__DIE__} = sub { our @reason = @_ };
215
+
216
BEGIN {
217
# Encapsulate a fully-qualified Postgresql table name
218
package Table;
@@ -943,12 +945,18 @@ foreach my $table (@tables) {
943
945
print "\n";
944
946
947
END {
948
+ our @reason;
949
950
# remove sample tables unless requested not to
951
if ($created_schema && !$opt{keep}) {
952
notice "Dropping sample schema $opt{sample_schema}\n";
953
$dbh->do("DROP SCHEMA $opt{sample_schema} CASCADE");
954
}
955
956
notice "Done.\n";
- exit 0;
957
+ if (@reason) {
958
+ exit 1;
959
+ } else {
960
+ exit 0;
961
+ }
962
0 commit comments