Skip site navigation (1) Skip section navigation (2)

Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant

From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant
Date: 2007-04-26 08:31:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Good day, Richard.

RH> <flight_chain ...>
RH>    <flight_options>
RH>      <flight...>
RH>      <flight...>  These three flights represent options
RH>      <flight...>
RH>    </flight_options>
RH> </flight_chain>

Tag <flight_options> is un-necessary (in point of view of DBMS theory).

RH> 2. If you nest flights then you'll be forced to repeat data, surely?
RH> Multiple routes could end up mentioning flight id=123 several times and
RH> each time have to repeat all possible options from it.

Remember, this is not manner of storing data in DBMS.
This is manner to visualize for man.

RH> I know whether a mentioned city is:
RH> 1. the start point of a flight
RH> 2. the end point of a flight

"city.flight" - city is start point,
"" - city is end point

>> Nearly: sorting by first section of tree
>> (maybe by second section and so on after that)
>> is not seggested now
>> (user can sort, for examle, in browser by XSL).

RH> Hang on, XSL is *not* easier to understand than SQL.

This means, that it's necessary to develop TML
(or HTML:

>> RH> syntax for these queries isn't obvious enough to me
>> What is not-obvious -
>> tree notation or work with fields inside section (record) in tree ?
>> If all of them, what is more not-obvious ?

RH> If I'm going to learn only one query language, it'll be SQL
RH> because everything uses it.

'tablename >>;' is better, than to learn php, perl, its library

>> XML is not stored thing, it is a transport form for scheme.
RH> Umm - xml schemas, that describe valid data for an xml document.

Term "scheme" means "database scheme" to me :)

RH> I'm sat here at my laptop, and I want to get a
RH> list of flights into a spreadsheet I'm doing for my boss.

Your boss will itself solve "task of travelling-salesman" ?
By eyes ?

RH> 1. How do I create my TML query (assuming I haven't read the TML manual,
RH> because if I can read manuals then SQL is viable)?

You start browser and open html-document on site of "list of flights".
Html-documents send XML data to Postgres (to site).
Postgres start function with name "main"
Function execute TML-request (it's made by authors of site !),
and Postgres send results to your browser.
You copy from browser into spreadsheet.

Thus you don't need to write request.
You will write TML-request, if you will author of site.

RH> 3. How do I get results into the spreadsheet?

It depends of data model:
if your get tree - there is no way in general case (i think),
if your get records of only one table/view:

create view x as
select as start, as end, flight.t1, flight.t2, day
from city, flight;
x >>;

then you get

<x start="A" end="B" t1="5.00"  t2="7.00"  day="monday">
<x start="K" end="L" t1="15.00" t2="17.00" day="sunday">

RH> How does this TML setup avoid me having to write any
RH> php/perl/etc?"

Look example about site of "list of flights" above.

RH> We're going to need a form that lets people choose from
RH> a list of start and end cities, pick a date and see a list of flights
RH> (sorted by cost, or length or some such). At present I'll build that
RH> with e.g. PHP + SQL => PostgreSQL. What part of the process does TML
RH> make easier?

You use only SQL and small simple part (simple part !) of TML to
transport data.

Soon i add sorting into TML.

Richard, send letter only to mailing list, not to me.

Dmitry Turin

In response to

pgsql-sql by date

Next:From: Dmitry TurinDate: 2007-04-26 08:33:02
Subject: Re: We all are looped on Internet: request + transport = invariant
Previous:From: Dmitry TurinDate: 2007-04-26 08:28:30
Subject: Re: Fwd: Re[2]: We all are looped on Internet: request + transport = invariant

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group