pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Dmitry Turin <sql4-en@narod.ru>
Cc: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: We all are looped on Internet: request + transport = invariant
Date: Fri, 20 Apr 2007 12:14:23 +0100
Message-ID: <4628A08F.9050804@archonet.com> (raw)
In-Reply-To: <814860828.20070420120819@narod.ru>
References: <14110647859.20070413105812@narod.ru>
	<20070413150936.GA31517@phlogiston.dyndns.org>
	<1684192906.20070419090827@narod.ru>
	<20070419134808.GB14187@phlogiston.dyndns.org>
	<814860828.20070420120819@narod.ru>

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

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



view thread (29+ messages)  latest in thread

Message-ID: <4628A08F.9050804@archonet.com>
Permalink:  ../4628A08F.9050804@archonet.com/
Also on:    postgresql.org/message-id/4628A08F.9050804@archonet.com

 · 

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: dev@archonet.com, sql4-en@narod.ru, ajs@crankycanuck.ca
  Subject: Re: We all are looped on Internet: request + transport = invariant
  In-Reply-To: <4628A08F.9050804@archonet.com>

* 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