Request into several DBMS simultaneously on DDL and DML

From: Dmitry Turin <html60_at_gmail.com>
Date: Fri, 24 Aug 2007 20:21:01 -0700
Message-ID: <1188012061.695021.180430_at_x35g2000prf.googlegroups.com>



(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.by.ru/site/sql40/en/author/mc_eng.htm Related ideas are on:
  http://sql40.by.ru/site/sql40/en/author/mc2_eng.htm Received on Sat Aug 25 2007 - 05:21:01 CEST

Original text of this message