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 experience with PostgreSQL so I thought I
would check with the list to see what if anything others had attempted.
Mon, 29 Oct 2001 11:27:20 -0500
"Sean K. Sell" <sean@nist.gov>
External Database Connection
"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 experience with 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.




Mon, 29 Oct 2001 12:30:15 -0500
mlw <markw@mohawksoft.com>
Re: External Database Connection
----- Original Message ----- 
From: Sean K. Sell <sean@nist.gov>
Sent: Monday, October 29, 2001 11:27 AM

> 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 experience with PostgreSQL so I thought I
> would check with the list to see what if anything others had attempted.

There is an upcoming implementation of schemas in PostgreSQL
hopefully for 7.3, and some work is being done already towards
it (see Bill Studenmund's proposed implementation of packages as a step
forward to the schemas and discussion arisen from it).
But for now, there is no such a hack to my knowledge.

-s



Mon, 29 Oct 2001 14:45:55 -0500
"Serguei Mokhov" <sa_mokho@alcor.concordia.ca>
Re: External Database Connection
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 experience with PostgreSQL so I thought I
> would check with the list to see what if anything others had attempted.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

Sort of (it's ugly, but works for simple needs) . . . see dblink under 
contrib in the 7.2 beta. Be sure to read the README.

-- Joe



Mon, 29 Oct 2001 21:38:44 -0800
Joe Conway <joseph.conway@home.com>
Re: External Database Connection