Re: We all are looped on Internet: request + transport = invariant

From: "Bart Degryse" <Bart(dot)Degryse(at)indicator(dot)be>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: We all are looped on Internet: request + transport = invariant
Date: 2007-04-20 11:14:49
Message-ID: 4628BCC8.A3DD.0030.0@indicator.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Trees like you seem to suggest are called hierarchies. If you prefer hierarchies over relationnality you could use a hierarchical database instead of a relational database. When you search the internet you can find plenty of information on eg Adabas, GT.M., IMS, DMSII, Focus, Metakit and many others.

>>> Dmitry Turin <sql4-en(at)narod(dot)ru> 2007-04-20 11:08 >>>
>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://html60.chat.ru/ )
http://sql40.chat.ru ( http://sql40.chat.ru/ )

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2007-04-20 11:29:30 Re: many 'OR' in WHERE-condition
Previous Message Richard Huxton 2007-04-20 11:14:23 Re: We all are looped on Internet: request + transport = invariant