in reply to Checking for DB table existence using DBI/DBD

The DBI table_info method is widely supported by DBD drivers and can be used to implement a preemptive test for the existance of a database table:
sub does_table_exist { my ($dbh,$table_name) = @_; my $sth = $dbh->table_info(undef, 'public', $table_name, 'TABLE'); $sth->execute; my @info = $sth->fetchrow_array; my $exists = scalar @info; return $exists; } foreach my $table ('foo', 'bar', 'items') { if (does_table_exist($dbh, $table)) { print "table $table exists\n"; } else { print "table $table does not exist\n"; } }