Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

DBI connect

by prafulltc (Acolyte)
on Nov 02, 2011 at 13:27 UTC ( #935395=perlquestion: print w/ replies, xml ) Need Help??
prafulltc has asked for the wisdom of the Perl Monks concerning the following question:

Hi ,

Can we connect to server using DBI->connect() without
mentioning dbname ?


Comment on DBI connect
Replies are listed 'Best First'.
Re: DBI connect
by moritz (Cardinal) on Nov 02, 2011 at 13:31 UTC
Re: DBI connect
by erix (Vicar) on Nov 02, 2011 at 14:35 UTC

    It depends on the DBI driver. PostgreSQL/DBD:Pg can work without dbname: for instance, it will default to the user name as database name, or it can take the value of environment variable 'PGDATABASE'.

    Updated 2011.12.14 (default dbname is user name, which is not necessarily 'postgres'...)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://935395]
Approved by moritz
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2016-02-09 13:15 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (315 votes), past polls