Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 ?


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 having an uproarious good time at the Monastery: (8)
As of 2016-10-25 11:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (317 votes). Check out past polls.