Skip to Content.
Sympa Menu

devel - AW: [sympa-dev] WG: List.pm::db_connect with Postgresql V 7.1 Err or

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Straub Herbert <address@concealed>
  • To: "'address@concealed '" <address@concealed>
  • Cc: "'Laurent LAVAUD '" <address@concealed>, "'Olivier Salaun '" <address@concealed>
  • Subject: AW: [sympa-dev] WG: List.pm::db_connect with Postgresql V 7.1 Err or
  • Date: Thu, 17 May 2001 13:16:11 +0200

Title: AW: [sympa-dev] WG: List.pm::db_connect with Postgresql V 7.1 Error

I don't no which version of postgresql requires the connect string dbname@localhost. In the newsgoups i found one hint:

 From: address@concealed (address@concealed)
Subject: watch your DBI scripts if you are upgrading to 7.1
Newsgroups: comp.databases.postgresql.general, comp.databases.postgresql.questions
Date: 2001-04-18 03:44:02 PST


psql no longer works the systax
        $ psql dbname@hostname

In my DBI scripts I had
        $d=DBI->connect('dbi:Pg:dbname=dbname@hostname','user')
That must be rewritten as
        $d=DBI->connect('dbi:Pg:dbname=dbname;host=hostname','user')


and a old Linux-Database-HOWTO from 8-DEC-1997 with the description (PostgreSQL 6.2 and DBD-Pg-0.63):

- - the data_source parameter of the connect method accepts two
  additional parameters which are  treated as host and port:
  DBI->connect("dbi:Pg:dbname:host:port", "uid", "pwd")


I successfully testing both connect strings with the versions:
RedHat 6.1
postgresql-6.5.2-1
postgresql-server-6.5.2-1
postgresql-perl-6.5.2-1
postgresql-devel-6.5.2-1
DBD-Pg-0.98

This is my oldest configuration for tests.

Ok, i forgot the connect string in include_users_sql (). The complete patch:

diff List.pm.orig List.pm
718,720d717
<     }elsif ($Conf{'db_type'} eq 'Pg') {
<       $connect_string = sprintf 'DBI:%s:dbname=%s\@%s', $Conf{'db_type'}, $Conf{'db_name'}, $Conf{'db_host'};
<
4314,4315d4310
<     }elsif ($db_type eq 'Pg') {
<       $connect_string = "DBI:Pg:dbname=$db_name\@$host";

Herbert


-----Originalnachricht-----
Von: Olivier Salaun
An: address@concealed; Straub Herbert
Cc: Laurent LAVAUD
Gesendet: 17.05.01 11:11
Betreff: Re: [sympa-dev] WG: List.pm::db_connect with Postgresql V 7.1 Error

> Straub Herbert wrote:
>
> The DBD::Pg PostgreSQL database driver for the DBI module says:
>
> connect:
> The following connect statement shows all possible parameters:
>
>  $dbh =
DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;options=$optio
ns;tty=$tty",
> "$username", "$password");
>
> Therefore I think, the elsif path for db_type eq 'Pg' is obsolete.
>
> I suggest the following patch (List.pm.orig is from the CVS Web
> V1.87):
>
> *** List.pm.orig        Thu May 17 07:58:10 2001
> --- List.pm     Thu May 17 07:58:34 2001
> ***************
> *** 715,723 ****
>       }elsif ($Conf{'db_type'} eq 'Sybase') {
>         $connect_string = sprintf 'DBI:%s:dbname=%s;server=%s',
> $Conf{'db_type'}, $Conf{'db_name'}, $Conf{'db_host'};
>
> -     }elsif ($Conf{'db_type'} eq 'Pg') {
> -       $connect_string = sprintf 'DBI:%s:dbname=%s\@%s',
> $Conf{'db_type'}, $Conf{'db_name'}, $Conf{'db_host'};
> -
>       }else {
>         $connect_string = sprintf 'DBI:%s:dbname=%s;host=%s',
> $Conf{'db_type'}, $Conf{'db_name'}, $Conf{'db_host'};
>       }
> --- 715,720 ----

We already changed the connect string for PostgreSQL in Sympa 2.5.4b
(March 2000).
It had been proposed by Laurent LAVAUD to change the connect string to :
        DBI:$db_type:dbname=$db_name\@$host

Are you sure your proposed connect string (the default one) will work
with
older versions of PostgreSQL ?

Note that List.pm has also connect strings in _include_users_sql().

--
Olivier Salaün
Comité Réseau des Universités



  • AW: [sympa-dev] WG: List.pm::db_connect with Postgresql V 7.1 Err or, Straub Herbert, 05/17/2001

Archive powered by MHonArc 2.6.19+.

Top of Page