You can set $dbh->{Warn} to 0 while executing the table creation statements. This has the drawback that other (possibly important) database error messages are also suppressed. So a better strategy can be do redefine $SIG{__WARN__} to only suppress specific warnings:
my $tmpwarn = $SIG{__WARN__}; $SIG{__WARN__} = sub { print STDERR @_ if $_[0] !~ m/NOTICE: CREATE TABLE/; }; $sth->execute(); $SIG{__WARN__} = $tmpwarn;
Or another option would of course be to redirect STDERR to a log file entirely.
In reply to Re: How to suppress notices using PostgreSQL with DBI
by tirwhan
in thread How to suppress notices using PostgreSQL with DBI
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |