pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tolik@aaanet.ru
To: Ene Cosmin <cosmox@email.ro>
Cc: pgsql-admin@postgresql.org
Subject: Re: DBI
Date: 01 Mar 2001 13:36:55 +0300
Message-ID: <86hf1dg4hk.fsf@tolikus.hq.aaanet.ru> (raw)
References: <200103010917.LAA08209@zerg.codec.ro>

>>>>> "EC" == Ene Cosmin <cosmox@email.ro> 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.<br>\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



view thread (4+ messages)  latest in thread

Message-ID: <86hf1dg4hk.fsf@tolikus.hq.aaanet.ru>
Permalink:  ../86hf1dg4hk.fsf@tolikus.hq.aaanet.ru/
Also on:    postgresql.org/message-id/86hf1dg4hk.fsf@tolikus.hq.aaanet.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tolik@aaanet.ru, cosmox@email.ro
  Subject: Re: DBI
  In-Reply-To: <86hf1dg4hk.fsf@tolikus.hq.aaanet.ru>
  References: <200103010917.LAA08209@zerg.codec.ro> <86hf1dg4hk.fsf@tolikus.hq.aaanet.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox