Received: from aaanet.ru (aaanet.ru [213.59.98.254]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f21Aatx26390 for ; Thu, 1 Mar 2001 05:36:56 -0500 (EST) (envelope-from tolik@tolikus.hq.aaanet.ru) Received: from tolikus.hq.aaanet.ru ([213.59.98.104]) by aaanet.ru with esmtp (Exim 3.12 #1) id 14YQS3-000EPd-00; Thu, 01 Mar 2001 13:36:51 +0300 Received: (from tolik@localhost) by tolikus.hq.aaanet.ru (8.9.3/8.9.3) id NAA06251; Thu, 1 Mar 2001 13:36:56 +0300 (MSK) (envelope-from tolik) To: Ene Cosmin Cc: pgsql-admin@postgresql.org Subject: Re: DBI References: <200103010917.LAA08209@zerg.codec.ro> Mime-Version: 1.0 (generated by tm-edit 1.5) Content-Type: text/plain; charset=US-ASCII From: tolik@aaanet.ru (Anatoly K. Lasareff) Date: 01 Mar 2001 13:36:55 +0300 In-Reply-To: Ene Cosmin's message of "Thu, 1 Mar 2001 11:17:06 +0200" Message-ID: <86hf1dg4hk.fsf@tolikus.hq.aaanet.ru> Lines: 32 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "Canyonlands" X-Archive-Number: 200103/5 X-Sequence-Number: 849 >>>>> "EC" == Ene Cosmin writes: EC> Hi. I need to know if I configure my psql with perl library I also need EC> the DBI::Pg class for quering my database in psql?. The following example EC> will work? EC> ------ EC> use DBI; EC> $dbh = new DBI( 'dbi:Pg:database;host', 'user', 'secret' ); EC> if( ! $dbh->dbh ){ EC> echo "Could not connect to the database.
\n"; EC> exit( ); EC> } EC> $sth = $dbh->prepare( 'SELECT COUNT(*) FROM some_table' ); EC> and sow on... EC> ------ EC> What else do I need to install for quering a database in this way? It seems to me your example is right. So you need modules: Pg (installs together with postgresql), DBI and DBD::Pg. -- Anatoly K. Lasareff Email: tolik@aaanet.ru http://tolikus.hq.aaanet.ru:8080 Phone: (8632)-710071