Use IF EXISTS
authorIan Barwick <ian@2ndquadrant.com>
Mon, 15 Dec 2014 05:27:30 +0000 (14:27 +0900)
committerIan Barwick <ian@2ndquadrant.com>
Mon, 15 Dec 2014 05:27:30 +0000 (14:27 +0900)
We may be executing this script several times on the same database.

src/test/regress/ddl-deparse/dump_regress_db.pl

index 263b80a1bda6a1e062a3f1d032cfb4243e186334..10e2ad1b9feb7e3348b16f9258b1452a96007075 100755 (executable)
@@ -79,7 +79,7 @@ my $pg_ctl= sprintf(
 `${pg_ctl} start`;
 
 my $psql_cmd = sprintf(
-    q|%s/src/bin/psql/psql -p %s -d regression -c 'DROP EVENT TRIGGER deparse_test_trg_ddl_command_end'|,
+    q|%s/src/bin/psql/psql -p %s -d regression -c 'DROP EVENT TRIGGER IF EXISTS deparse_test_trg_ddl_command_end'|,
     $options{'top-builddir'},
     $options{'port'},
 );