Thread: Select between two databases
Hi, Does any one know how I may select between two databases running on same machine or on different machines eg. select colA1 from tableA1 where colA2 in (select colB1 from tableB1); here tableA1 and tableB1 are in different databases. The two databases might be under the same postmaster or on different machines under different postmasters. How do I query both simultaneously? Is it possible? Thanks, Indraneel /************************************************************************. # Indraneel Majumdar ¡ E-mail: indraneel@123india.com # # Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com # # Centre for DNA Fingerprinting and Diagnostics, # # Hyderabad, India - 500076 # `************************************************************************/
Not sure if same can be accomplished with different servers. Try the following for database's on one server, use alias & dot notation... select a1.colA1 from myDatabase1.tableA1 a1 where a1.A2 in (select b1.colB1 from myDatabase2.tableB1 b1) Indraneel Majumdar wrote: > Hi, > > Does any one know how I may select between two databases running on same > machine or on different machines eg. > > select colA1 from tableA1 where colA2 in (select colB1 from tableB1); > > here tableA1 and tableB1 are in different databases. The two databases > might be under the same postmaster or on different machines under > different postmasters. How do I query both simultaneously? Is it possible? > > Thanks, > Indraneel > > /************************************************************************. > # Indraneel Majumdar ¡ E-mail: indraneel@123india.com # > # Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com # > # Centre for DNA Fingerprinting and Diagnostics, # > # Hyderabad, India - 500076 # > `************************************************************************/
Not working, but thanks anyway. Can anyone point out the relevant area of the source where queries are handled? Thanks, Indraneel On Sun, 24 Sep 2000, Fredrick Bartlett wrote: > Not sure if same can be accomplished with different servers. > Try the following for database's on one server, use alias & dot notation... > > select a1.colA1 from > myDatabase1.tableA1 a1 > where a1.A2 in (select b1.colB1 from myDatabase2.tableB1 b1) > /************************************************************************. # Indraneel Majumdar ¡ E-mail: indraneel@123india.com # # Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com # # Centre for DNA Fingerprinting and Diagnostics, # # Hyderabad, India - 500076 # `************************************************************************/
On Sun, 24 Sep 2000, Indraneel Majumdar wrote: > Does any one know how I may select between two databases running on same > machine or on different machines eg. > > select colA1 from tableA1 where colA2 in (select colB1 from tableB1); > > here tableA1 and tableB1 are in different databases. The two databases > might be under the same postmaster or on different machines under > different postmasters. How do I query both simultaneously? Is it possible? Currently postgres databases may not be spanned in queries.
Hi ppl, Just wondering if anyone knows if its possible to set the transaction isolation level from inside a stored procedure in plpgsql. Or do I need to run the 'set transaction isolation level' command before I called the stored procedure? I'm not even sure that would work, I assume plpgsql uses the current transaction isolation level? Any help would be much appreciated :) Cheers, Keith.