pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bart Degryse <Bart.Degryse@indicator.be>
To: pgsql-sql@postgresql.org
Subject: Re: We all are looped on Internet: request + transport = invariant
Date: Fri, 20 Apr 2007 13:14:49 +0200
Message-ID: <4628BCC8.A3DD.0030.0@indicator.be> (raw)
In-Reply-To: <814860828.20070420120819@narod.ru>
References: <14110647859.20070413105812@narod.ru>
	<20070413150936.GA31517@phl ogiston.dyndns.org>
	<1684192906.20070419090827@narod.ru>
	<20070419134808.GB14 187@phlogiston.dyndns.org>
	<20070419134808.GB14187@phlogiston.dyndns.org>
	<81 4860828.20070420120819@narod.ru>

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@narod.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

view thread (29+ messages)  latest in thread

Message-ID: <4628BCC8.A3DD.0030.0@indicator.be>
Permalink:  ../4628BCC8.A3DD.0030.0@indicator.be/
Also on:    postgresql.org/message-id/4628BCC8.A3DD.0030.0@indicator.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Bart.Degryse@indicator.be
  Subject: Re: We all are looped on Internet: request + transport = invariant
  In-Reply-To: <4628BCC8.A3DD.0030.0@indicator.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox