vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:

I am using DBI module to connect my postgres/sql database,How can I find that the database is already exists or not?

Replies are listed 'Best First'.
Re: Database connection checking.
by pajout (Curate) on Feb 06, 2009 at 10:40 UTC
    $dbh->ping

    man DBI

Re: Database connection checking.
by Corion (Patriarch) on Feb 06, 2009 at 10:40 UTC

    Look in the DBI documentation. It has methods to list all databases on a machine (if you have the appropriate privileges).

    Alternatively, if Database connection checking. is your question, you need to cache the existing connection to your database in your application somewhere. Possibly by using Apache::DBI or by using its techniques.

Re: Database connection checking.
by erix (Prior) on Feb 06, 2009 at 13:30 UTC