Re: Pg 7.3.1 & DBD::Pg 1.21

From: Renê Salomão <rene(at)ibiz(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Pg 7.3.1 & DBD::Pg 1.21
Date: 2003-01-23 18:57:09
Message-ID: 20030123165709.356e2f0b.rene@ibiz.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 the following message appears...

DBI connect('dbname=slave;host=164.35.10.17;port=5432','username=pgsql',...) failed: could not connect to server: Connection refused 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(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> =?ISO-8859-1?Q?Ren=EA_Salom=E3o?= <rene(at)ibiz(dot)com(dot)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(at)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";

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-01-23 19:01:21 Re: standard schemas for addresses, others?
Previous Message Dennis Gearon 2003-01-23 18:56:27 Re: standard schemas for addresses, others?