Re: External Database Connection - Mailing list pgsql-hackers

From mlw
Subject Re: External Database Connection
Date
Msg-id 3BDD9227.D7C7F58D@mohawksoft.com
Whole thread Raw
In response to External Database Connection  ("Sean K. Sell" <sean@nist.gov>)
List pgsql-hackers
"Sean K. Sell" wrote:

> Has anyone successfully hacked an external database table as a view.
>
> I was thinking that this may be possible using a C function and the Rules architecture but I don't have much
experiencewith PostgreSQL so I thought I
 
> would check with the list to see what if anything others had attempted.
>

Using C functions, you could probably do something like this:

create view dbname_table as select ext_query('select * from table', 'dbname'), extq_col_varchar('foo') as foo,
extq_col_numeric('bar')as bar
 

It would not be a generic solution, but it could be done with today's sources.





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Next
From: Bill Studenmund
Date:
Subject: Re: Proposed new create command, CREATE OPERATOR CLASS