Re: We all are looped on Internet: request + transport = invariant - Mailing list pgsql-sql
From | Dmitry Turin |
---|---|
Subject | Re: We all are looped on Internet: request + transport = invariant |
Date | |
Msg-id | 814860828.20070420120819@narod.ru Whole thread Raw |
In response to | Re: We all are looped on Internet: request + transport = invariant (Andrew Sullivan <ajs@crankycanuck.ca>) |
Responses |
Re: We all are looped on Internet: request + transport = invariant
Re: We all are looped on Internet: request + transport = invariant |
List | pgsql-sql |
>you are proposing is to ... break the relational model of SQL No. I'm proposing to add new thinking about relational model (primary i want to write "to add new view", but i remember, that "view" is reserved word in SQL :) ). Сonvince yourself, please: create table a ( id num primary key; data float; ); create table b ( id num primary key; ref num references a(id); data float; ); create table c ( id num primary key; link num references b(id); data float; ); insert into a values (1, 12.3); insert into b values (10, 1, 23.4); insert into b values (20, 1, 34.5); insert into b values (30, 1, 45.6); insert into c values (100,10,56.7); insert into c values (101,10,67.8); insert into c values (200,20,78.9); insert into c values (201,20,89.1); insert into c values (300,30,91.2); My suggest is "a.b.c"-request. Output is <a id=1 data=12.3> <b id=10 data=23.4> <c id=100 data=56.7/> <c id=101 data=67.8/> </b> <b id=20 data=34.5> <c id=200 data=78.9/> <c id=201 data=89.1/> </b> <b id=30 data=45.6> <c id=200 data=91.2/> </b> </a> I wrote about that in http://sql4.by.ru/site/sql40/en/author/introduction_eng.htm http://sql4.by.ru/site/sql40/en/author/determination_eng.htm >to make it look more like XML Understand: XML is not model of data (in my suggest), XML is format of output. Can you offer better format for output of tree? If you can, write please, i listen. >because of some special purpose application Reception of tree from database is really often case. For example, open several schemes of database (in Erwin, in RationalRose, in other modeller) - scheme is net (count). After that, look at source of server programs, servicing this databases. These programs get part of net (not part of one table!, not part of joined tables! not part of one view!) and put it into program-visualizer. In back direction, server program get tree (records for several tables, not for one table!) and put it into database. >SQL ... It's ... language, unconcerned with transport I agree. Now it's so. >change the syntax of SQL SQL remains inviolate. I offer addition to it - i offer Tree Manipulation Language. Look once more: create table a ( id num primary key; data float; ); create table b ( id num primary key; ref1 num references a(id); ref2 num references a(id); data float; ); create table c ( id num primary key; lnk1 num references b(id); lnk2 num references b(id); data float; ); insert into a values (1, 12.3); insert into a values (2, 23.4); insert into b values (10, 1, 2, 34.5); insert into b values (20, 1, 2, 45.6); insert into b values (30, 1, 2, 56.7); insert into b values (40, 1, 2, 67.8); insert into c values (100,10,20,78.9); insert into c values (101,10,20,89.1); insert into c values (200,30,40,91.2); insert into c values (201,30,40,88.8) But TML is: a.b/ref1.c/lnk1 --- P.S. I'm very glad to get acquainted with you, and i'm much interesting to talk with you. Let's to write maximum simply, let's to use maximum simple expressions to understand each other better. Dmitry Turin http://html60.chat.ru http://sql40.chat.ru