Currently you can use dblink which queries a remote database and returns the data as a table. This works nicely for PostgreSQL. There is also a JDBC version in progress.
We have writte an Oracle version of dblink.
SELECT * FROM dblink('connectstr', 'SELECT ...') AS some_type;
This works nicely.
Still, this is not a full implementation of distributed queries - this would be a huge project. There has already been some discussion about that on the hackers list.
Regards,
Hans
Richard Schilling wrote:
As luck would have I've put some thought into this problem before as well. Having reviewed the code quite a bit, and played around with the backend, my intuition tells me that the following would work.
Write a custom "cluster-aware" postmaster so it distributes queries to various machines. Of course each machine would have to be running a normal postmaster to receive the queries. And, the cluster-aware postmaster would need to be informed of which machines to submit queries to (e.g. listed in a configuration file). Queries could be processed in the following ways:
* database management queries (e.g. create database, create table, alter table, etc. . . ) would be distributed to every machine
* select queries would be distributed to every machine. The cluster-aware postmaster would merge the results before delivering them to the client.
* an insert query would go to one machine only, and the cluster-aware postmaster could switch between the designated machines after each insert. For example, given two machines, the first insert would go to machine A, the second to machine B, etc . . .
Don't know if that's been tried, but that's where I would start. Postgres' modular design of a postmaster and a backend would make this relatively easy to do, because the only thing you might end up writing is the one cluster-aware postmaster. If you end up doing this let me know and if I have time I'll help out with the design/coding.
Richard Schilling Lake Stevens, WA USA
On 2003.07.04 18:56 MIka Santos wrote:
Gud day! We are currently having our thesis for our undergarduate course and this involoves the code of PostgreSQL. Basically, our thesis needs a modification of the existing code of the said database. As of now, our University has an existing online registration system which uses Postgre as their back end. But the problem is the existing one is not a distributed system. Our thesis adviser would like us to deal with the load balancing of the said online registration. He wanted a multidatabase querying. For example, we knew that the following statements are posible, select * from t1, t2., t3; provided that t1 and t2, t3 are tables from a single database. Our thesis is to make the following satatement legal select * from d1, d2, d3; provided that d1 and d2, d3 are separate databases. We are currently having our research about this problem and as beginners, we surely need help from experts like you. Any form of comments and suggestions will surely be appreciated by the group. Thank you very much and hope to here from you.
-- Cybertec Geschwinde u Schoenig Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria Tel: +43/2952/30706; +43/664/233 90 75 www.cybertec.at, www.postgresql.at, kernel.cybertec.at
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly