Skip site navigation (1) Skip section navigation (2)

Re: How to write sql to access another odbc source.

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Rich <rhdyes(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to write sql to access another odbc source.
Date: 2011-10-25 07:59:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On 19/10/11 22:08, Rich wrote:
> I have a mumps database with an ODBC connection so I can write queries
> from other databases.  How can I write a sql in Postgresql to access
> this table to use in my Postgresql reports?

Use dbi-link to make an ODBC connection to the other database. Either
copy the data into a PostgreSQL table for processing, or make a view
over the dbi-link function call to query the data each time. The latter
option is slow, but requires no periodic refreshing of the copied table.

If you're on PostgreSQL 9.1 I'd recommend copying the data from the
other database via dbi-link into an unlogged table.

See: and the documentation for
the dbi-link contrib module in your version of PostgreSQL.

Hopefully in 9.2 the odbc foreign data wrapper will be working and ready
for general use, in which case you'll be able to do it even more easily

Craig Ringer

In response to

pgsql-sql by date

Next:From: Harald FuchsDate: 2011-10-25 12:42:34
Subject: Re: CTE or Subselect and outer joins not behaving as expected?
Previous:From: Brice AndréDate: 2011-10-25 06:02:19
Subject: Re: Handling mutliple clients access with views

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group