Обсуждение: External Database Connection

Поиск
Список
Период
Сортировка

External Database Connection

От
"Sean K. Sell"
Дата:
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
withPostgreSQL so I thought I
 
would check with the list to see what if anything others had attempted.

Re: External Database Connection

От
mlw
Дата:
"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.





Re: External Database Connection

От
"Serguei Mokhov"
Дата:
----- 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




Re: External Database Connection

От
Joe Conway
Дата:
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.
> 
> ---------------------------(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