Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

DBI connect

by prafulltc (Acolyte)
on Nov 02, 2011 at 13:27 UTC ( [id://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 ?

Regards,
Prafull

Replies are listed 'Best First'.
Re: DBI connect
by moritz (Cardinal) on Nov 02, 2011 at 13:31 UTC
Re: DBI connect
by erix (Prior) 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-03-19 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found