Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 751C09FBA3A for ; Fri, 20 Apr 2007 08:14:33 -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 13014-07 for ; Fri, 20 Apr 2007 08:14:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 631729FB39E for ; Fri, 20 Apr 2007 08:14:29 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id C4E32743F5; Fri, 20 Apr 2007 12:14:23 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 8A2712740D7; Fri, 20 Apr 2007 12:14:23 +0100 (BST) Message-ID: <4628A08F.9050804@archonet.com> Date: Fri, 20 Apr 2007 12:14:23 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Dmitry Turin Cc: Andrew Sullivan , pgsql-sql@postgresql.org Subject: Re: We all are looped on Internet: request + transport = invariant References: <14110647859.20070413105812@narod.ru> <20070413150936.GA31517@phlogiston.dyndns.org> <1684192906.20070419090827@narod.ru> <20070419134808.GB14187@phlogiston.dyndns.org> <814860828.20070420120819@narod.ru> In-Reply-To: <814860828.20070420120819@narod.ru> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.693 tagged_above=0 required=5 tests=AWL=-1.082, BAYES_50=0.001, FORGED_RCVD_HELO=0.135, URIBL_SBL=1.639 X-Spam-Level: X-Archive-Number: 200704/173 X-Sequence-Number: 28173 Dmitry Turin wrote: >> 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 > > > > > > > > > > > > > > > > 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. Your format seems to have thrown away all type information. How do I know with the "id=200" that 200 is an int rather than a byte or string? Also, how do we add the new table? CREATE TABLE d ( aref num references a, bref num references b, cref num references c ); >> because of some special purpose application > > Reception of tree from database is really often case. Well it's sometimes the case. I'm not sure you've given any evidence that *most* (or even many) accesses to a database want to retrieve a simple tree. And only a tree - presumably your alternative access method doesn't let me grab "nets" (directed graphs, possibly cyclic). > For example, open several schemes of database (in Erwin, in > RationalRose, in other modeller) - scheme is net (count). So - not a tree? > 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. Also not trees (necessarily) > In back direction, server program get tree (records for several tables, not for one table!) > and put it into database. I'm not sure that anyone is clear why you just don't write this as a simple php/perl/ruby/whatever script? There are libraries that will output XML for you in most of these I'd suspect, and if not it's just an afternoon's work. I mean, your application is written in *some* language, isn't it? -- Richard Huxton Archonet Ltd