Re: Pg 7.3.1 & DBD::Pg 1.21
От | Renê Salomão |
---|---|
Тема | Re: Pg 7.3.1 & DBD::Pg 1.21 |
Дата | |
Msg-id | 20030123165709.356e2f0b.rene@ibiz.com.br обсуждение исходный текст |
Ответ на | Re: Pg 7.3.1 & DBD::Pg 1.21 (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Pg 7.3.1 & DBD::Pg 1.21
(Tom Lane <tgl@sss.pgh.pa.us>)
|
Список | pgsql-general |
Tom lane, I've restarted Pg before, that's why still received the error message... Now that I've stopped and started it again thefollowing message appears... DBI connect('dbname=slave;host=164.35.10.17;port=5432','username=pgsql',...) failed: could not connect to server: Connectionrefused at pg_connect.pl line 16 Is there any compatible problem with Pg and DBD::Pg? What am I doing wrong? =o) Thanks... On Thu, 23 Jan 2003 12:58:51 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote: > =?ISO-8859-1?Q?Ren=EA_Salom=E3o?= <rene@ibiz.com.br> writes: > > I was trying to connect to Pg 7.3.1 using perl and DBD::Pg 1.21, however the following error occurs: > > $ perl pg_connect.pl > > FATAL: No pg_hba.conf entry for host 164.35.10.17, user pgsql, database slave > > The error message is pretty specific. Are you sure you edited the right > pg_hba.conf? Did you SIGHUP the postmaster after you edited it? > > regards, tom lane > Thanks. ----------------------------- Renê Salomão Ibiz Tecnologia -- www.ibiz.com.br $ psql -l -p 5432 List of databases Name | Owner -----------+------- slave | pgsql template0 | pgsql template1 | pgsql (3 rows) Versão: [pgsql@slave:5432]#select version(); -[ RECORD 1 ]-------------------------------------------------------- version | PostgreSQL 7.3.1 on i586-pc-linux-gnu, compiled by GCC 2.96 PG_HBA.CONF: # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD local all all trust host all all 127.0.0.1 255.255.255.255 trust host all all 164.35.10.17 255.255.255.0 trust Versão: $ perl -e 'use DBI; print "$DBI::VERSION\n"' --> 1.32 $ perl -e 'use DBD::Pg; print "$DBD::Pg::VERSION\n";' --> 1.21 Função Perl: #!/usr/bin/perl use DBI; use DBD::Pg; use strict; my $dbh; my $dbname='slave'; my $host='164.35.10.17'; my $port='5432'; my $options=''; my $username='pgsql'; my $password='pgsql'; $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port", "$username", "$password", { RaiseError => 1, AutoCommit => 0 }) || die $DBI::errstr; print "Connected!!!\n"; my $hSt = $dbh->prepare('SELECT * FROM table;'); $hSt->execute; while(my @raD = $hSt->fetchrow_array()) { print "$raD[0]\t$raD[1]\n";} $hSt->finish; $dbh->disconnect; print "Disconnected!!!\n";
В списке pgsql-general по дате отправления: