How does one connect to a remote database using dbi?

I’ve looked at the examples and I can connect to a local data base. What is
the syntax for connecting to a remote database using dbi and postgresql?

Thanks
Ernie

connection = DBI.connect(‘dbi:Pg:dbname=foo;host=foo.bar.com;port=5432’,
‘someuser’, 'somepassword)

···

On Mon, 17 Feb 2003 18:27:16 -0500, Ernie wrote:

I’ve looked at the examples and I can connect to a local data base. What
is the syntax for connecting to a remote database using dbi and
postgresql?

Thanks
Ernie

Thanks for your help. I have dbi and postgresql up and running and have
accessed both remote and local data bases, successfully done queries,
inserts, updates, and transactions.
Thanks for all the help.
By the way dbi rocks.

Ernie
“Gabriel Emerson” egabriel@io.com wrote in message
news:pan.2003.02.17.23.58.47.718188@io.com

connection = DBI.connect(‘dbi:Pg:dbname=foo;host=foo.bar.com;port=5432’,
‘someuser’, 'somepassword)

I’ve looked at the examples and I can connect to a local data base.
What

···

On Mon, 17 Feb 2003 18:27:16 -0500, Ernie wrote:

is the syntax for connecting to a remote database using dbi and
postgresql?

Thanks
Ernie

can someone illuminate me as to the advantages of using DBI? it seems that
for most applications one will make use of vendor specific SQL and thus lose
portability of database code. am i mistaken to think this way? personally i
find the postgres module so easy to use it’s hard to imagine something
easier…

perplexed.

-a

···

On Wed, 19 Feb 2003, Ernie wrote:

Thanks for your help. I have dbi and postgresql up and running and have
accessed both remote and local data bases, successfully done queries,
inserts, updates, and transactions.
Thanks for all the help.
By the way dbi rocks.

Ernie
“Gabriel Emerson” egabriel@io.com wrote in message
news:pan.2003.02.17.23.58.47.718188@io.com

connection = DBI.connect(‘dbi:Pg:dbname=foo;host=foo.bar.com;port=5432’,
‘someuser’, 'somepassword)

On Mon, 17 Feb 2003 18:27:16 -0500, Ernie wrote:

I’ve looked at the examples and I can connect to a local data base.
What
is the syntax for connecting to a remote database using dbi and
postgresql?

Thanks
Ernie

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================

can someone illuminate me as to the advantages of using DBI? it seems that
for most applications one will make use of vendor specific SQL and thus lose
portability of database code. am i mistaken to think this way? personally i
find the postgres module so easy to use it’s hard to imagine something
easier…

perplexed.

-a

For a consistent API mainly. It’s not uncommon to have multiple DBMS within the
same company. We mainly use Oracle here at work, but there are also DB2
databases, plus a few folks have created home-grown MS Access (ick) and MySQL
databases. We currently are using Oracle for our own development team but are
considering a switch to postgres or mysql.

I have no idea if the API between the oracle, postgres and mysql driver are the
same (I doubt it), but by using DBI, I don’t need to worry about it.

Regards,

Dan

···


a = [74, 117, 115, 116, 32, 65, 110, 111, 116, 104, 101, 114, 32, 82]
a.push(117,98, 121, 32, 72, 97, 99, 107, 101, 114)
puts a.pack(“C*”)

a nice answer which is also convincing.

thanks.

-a

···

On Thu, 20 Feb 2003, Daniel Berger wrote:

can someone illuminate me as to the advantages of using DBI? it seems that
for most applications one will make use of vendor specific SQL and thus lose
portability of database code. am i mistaken to think this way? personally i
find the postgres module so easy to use it’s hard to imagine something
easier…

perplexed.

-a

For a consistent API mainly. It’s not uncommon to have multiple DBMS within the
same company. We mainly use Oracle here at work, but there are also DB2
databases, plus a few folks have created home-grown MS Access (ick) and MySQL
databases. We currently are using Oracle for our own development team but are
considering a switch to postgres or mysql.

I have no idea if the API between the oracle, postgres and mysql driver are the
same (I doubt it), but by using DBI, I don’t need to worry about it.

Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================