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: Pg 7.3.1 & DBD::Pg 1.21
Date: 2003-01-23 17:29:35
Message-ID: 20030123152935.7f5e3477.rene@ibiz.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
DBI connect('dbname=slave;host=164.35.10.17;port=5432','pgsql',...) failed: FATAL: No pg_hba.conf entry for host 164.35.10.17, user pgsql, database slave at pg_connect.pl line 16
$

Does anybody know what is wrong? Weird that the same function in perl works fine in 7.2.3....

Thanks.
-----------------------------
Renê Salomão
Ibiz Tecnologia -- www.ibiz.com.br

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

$ psql -l -p 5432
List of databases
Name | Owner
-----------+-------
slave | pgsql
template0 | pgsql
template1 | pgsql
(3 rows)

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.0.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 dev 2003-01-23 17:48:17 Re: I was spoiled by the MySQL timestamp field
Previous Message Dennis Gearon 2003-01-23 17:02:58 ORDER BY 'criteria'