Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3FF4A9F98F9 for ; Tue, 28 Aug 2007 01:45:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 56269-04 for ; Tue, 28 Aug 2007 01:45:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from webmail10.mail.yandex.net (webmail10.mail.yandex.net [213.180.200.51]) by postgresql.org (Postfix) with ESMTP id 2D1089F98DA for ; Tue, 28 Aug 2007 01:45:01 -0300 (ADT) Received: from YAMAIL (webmail10) by mail.yandex.ru id S4059378AbXH1Eot for ; Tue, 28 Aug 2007 08:44:49 +0400 X-Yandex-Spam: 1 Received: from [82.209.216.190] ([82.209.216.190]) by mail.yandex.ru with HTTP; Tue, 28 Aug 2007 08:44:49 +0400 From: Kitter Georgiy To: pgsql-sql@postgresql.org Subject: Request into several DBMS simultaneously on DDL and DML MIME-Version: 1.0 Message-Id: <195471188276289@webmail10.yandex.ru> Date: Tue, 28 Aug 2007 08:44:49 +0400 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/228 X-Sequence-Number: 29166 (1)Let's allow to __connect into several DBMS__ at once, last of them becomes DBMS 'by default'. User assign any nickname to each database at connection, except nickname 'all' and 'local', e.g. connect ra=database.remote.com username=Smith password=pwds nickname=db1; connect ra=db.distination.com username=Tomson password=pwdt nickname=db2; connect ra=database.remote.com username=Johnson password=pwdj nickname=db3; And user can change DBMS by default, e.g. local db2; Each time, when __name of datatype, table, view, sequence, index, trigger, function, procedure, user, role__ is used, it's implied, that object is in database by default, e.g. create type NAME ... alter table NAME ... drop sequence NAME ... create index NAME ... replace trigger NAME ... drop function NAME ... insert into NAME ... select ... from NAME ... create user NAME ... create role NAME ... grant NAME to NAME (2)Let's allow to specify __location of object by prefix__, which is before name through colon. Prefix can be (2.1) nickname of concrete database, e.g. select ... from db1:NAME ... insert into db3:NAME ... (2.2) predicate "all:" (which designates all databases), "local:" (which designate database by default), e.g. insert into all:NAME ... select ... from local:NAME ... select ... where fld > any (select ... from all:NAME ... (2.3) marker - word, meaning all databases consecutively (__any two markers never simultaneously mean the same database__). Sign "%" is put before marker, e.g. insert into %db1:NAME select * from %db2:NAME; (3) As result, __new type of system information__ appears: field, refering to other field by foreign key, has additional bit except own value - bit specifies, whether record, to which it refers, is in the same or in other database. It's necessary to not signalize about break of foreign key, if remote database will not connected in next time. (4) After all said, __replication__ of databases by branded programs loss all sense - always it's possible to make it by extension of SQL, described above. Document is stated on http://sql40.chat.ru/site/sql40/en/author/mc_eng.htm Related ideas are on: http://sql40.chat.ru/site/sql40/en/author/mc2_eng.htm Dmitry Turin SQL4 (4.2.0) http://sql40.chat.ru HTML6 (6.4.0) http://html60.chat.ru Unicode2 (2.0.1) http://unicode2.chat.ru Computer2 (2.0.3) http://computer20.chat.ru