pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to write sql to access another odbc source.
2+ messages / 2 participants
[nested] [flat]

* How to write sql to access another odbc source.
@ 2011-10-19 14:08  Rich <rhdyes@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Rich @ 2011-10-19 14:08 UTC (permalink / raw)
  To: pgsql-sql

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?

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to write sql to access another odbc source.
@ 2011-10-25 07:59  Craig Ringer <ringerc@ringerc.id.au>
  parent: Rich <rhdyes@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Craig Ringer @ 2011-10-25 07:59 UTC (permalink / raw)
  To: Rich <rhdyes@gmail.com>; +Cc: 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: http://pgfoundry.org/projects/dbi-link 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
using ODBC FDW (SQL/MED).



--
Craig Ringer



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-10-25 07:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-19 14:08 How to write sql to access another odbc source. Rich <rhdyes@gmail.com>
2011-10-25 07:59 ` Craig Ringer <ringerc@ringerc.id.au>

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