Thread: query on two databases ..

query on two databases ..

From
"Muhammed Yazici"
Date:
hi,
i'am really new to postgresql and i try it with php ..

Now i have following question :

is it possible to make one query on two databases. I have a database calles
db1 and one db2 and i want to get :


select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
":db2:table1" );

(this query will work in interbase dbs)

how is the right syntax in postgresql ??

can anybody help my .. i looked in diffent manuals but i couldnt find the
syntax ..

thanks a lot for your help in forward ..

m. Yazici
yazici@chss.net




Re: query on two databases ..

From
Nils Zonneveld
Date:

Muhammed Yazici wrote:
> 
> hi,
> i'am really new to postgresql and i try it with php ..
> 
> Now i have following question :
> 
> is it possible to make one query on two databases. I have a database calles
> db1 and one db2 and i want to get :
> 
> select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
> ":db2:table1" );
> 
> (this query will work in interbase dbs)
> 
> how is the right syntax in postgresql ??
> 
> can anybody help my .. i looked in diffent manuals but i couldnt find the
> syntax ..
> 
> thanks a lot for your help in forward ..
> 
> m. Yazici
> yazici@chss.net

While schema's have not (yet) been implemented, it's not possible to
refer to two database in one SQL statement in PostgreSQL.

Regards,

Nils


Re: query on two databases ..

From
"Muhammed Yazici"
Date:
...sh*

But thanx ..
i'll try another solution ..


"Nils Zonneveld" <nils@mbit.nl> schrieb im Newsbeitrag
news:3B151F78.D30560BE@mbit.nl...
>
>
> Muhammed Yazici wrote:
> >
> > hi,
> > i'am really new to postgresql and i try it with php ..
> >
> > Now i have following question :
> >
> > is it possible to make one query on two databases. I have a database
calles
> > db1 and one db2 and i want to get :
> >
> > select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1"
from
> > ":db2:table1" );
> >
> > (this query will work in interbase dbs)
> >
> > how is the right syntax in postgresql ??
> >
> > can anybody help my .. i looked in diffent manuals but i couldnt find
the
> > syntax ..
> >
> > thanks a lot for your help in forward ..
> >
> > m. Yazici
> > yazici@chss.net
>
> While schema's have not (yet) been implemented, it's not possible to
> refer to two database in one SQL statement in PostgreSQL.
>
> Regards,
>
> Nils




Re: query on two databases ..

From
Stephan Szabo
Date:
There is currently no ability to span databases in a single
query.

On Wed, 30 May 2001, Muhammed Yazici wrote:

> hi,
> i'am really new to postgresql and i try it with php ..
> 
> Now i have following question :
> 
> is it possible to make one query on two databases. I have a database calles
> db1 and one db2 and i want to get :
> 
> 
> select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
> ":db2:table1" );
> 
> (this query will work in interbase dbs)
> 
> how is the right syntax in postgresql ??
> 
> can anybody help my .. i looked in diffent manuals but i couldnt find the
> syntax ..
> 
> thanks a lot for your help in forward ..