Re: Problems with PostgreSQL DBI-Link / DBD-ODBC - Mailing list pgsql-general

From David Fetter
Subject Re: Problems with PostgreSQL DBI-Link / DBD-ODBC
Date
Msg-id 20071030150142.GT14638@fetter.org
Whole thread Raw
In response to Re: Problems with PostgreSQL DBI-Link / DBD-ODBC  ("Pit M." <fmi-soft@gmx.de>)
Responses Re: Problems with PostgreSQL DBI-Link / DBD-ODBC  ("Pit M." <fmi-soft@gmx.de>)
List pgsql-general
On Tue, Oct 30, 2007 at 01:12:41PM +0100, Pit M. wrote:
> Hi David!
>
> Thanks for the fast reply. So you mean that I might already have
> created a connection but am still trying to create the same one
> again?

Yes.

> >>Check whether the existing one works :)
> So how can I test it?

Fire up psql and do:

SELECT
    data_source_id,
    local_schema,
    data_source
FROM
    dbi_link.dbi_conection;

This gives you schemas you have created successfully.  You can then
check what's in schema foo by doing:

\dv foo.*

> What is the correct way of accessing this data source in a select
> statement?
>
> Concerning the documents, I wouldn't say that they are unclear about
> make_accessor_functions().  The problem is, that in the dbi-link
> documents (quote: "Do the following, with the appropriate
> parameters.  "Appropriate parameters" come from the perldoc of the
> appropriate DBD...") and in the dbi-odbc documents I can't find any
> information about the correct use of the parameters for the
> ODBC-connection. That's why I tried to create the connection so many
> times.

Ah, I see.  I don't have an example of dbd-odbc just yet, but you
should be able to write a very short perl program which connects to
your data source.

http://www.easysoft.com/developer/languages/perl/dbd_odbc_tutorial_part_1.html

Once you've verified that that's working, you can set up a new
connection.  The parameters you pass into $dbh coincide, not
coincidentally, with the first inputs to make_accessor_functions :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

pgsql-general by date:

Previous
From: Brian Wipf
Date:
Subject: Re: Base Backups from PITR Standby
Next
From: Bob Pawley
Date:
Subject: Re: PostgreSQL and AutoCad