Search Postgresql Archives

Re: Connect to postgresql database using Perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dipti shah wrote:
Thanks Guys. DBI works fine. I have written below code but it executes only on the server where I installed postgresql. Is there any way to run this code from remote host. I get an error when trying to run it from remote host. I think it is obvious because in below code there is no information where to connect to. Could you please help me out.

use DBI;
$DB_name    = 'mydb';
$DB_user    = 'postgres';
$DB_pwd     = '';
$dbh = DBI->connect("dbi:Pg:dbname=$DB_name","$DB_user","$DB_pwd");
...

see http://search.cpan.org/~turnstep/DBD-Pg-2.16.1/Pg.pm#connect <http://search.cpan.org/%7Eturnstep/DBD-Pg-2.16.1/Pg.pm#connect>

add ;host=hostname-or-ip to the connect string...

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux