Re: Tuple data - Mailing list pgsql-hackers

From Emmanuel Charpentier,,,
Subject Re: Tuple data
Date
Msg-id 3A3DC70D.7050703@bacbuc.dyndns.org
Whole thread Raw
In response to Re: Tuple data  (Hiroshi Inoue <Inoue@tpf.co.jp>)
List pgsql-hackers
Hiroshi Inoue wrote :

[ ... ]

> Column order isn't essential in rdbms.

<Nitpicking>

A relation (a table) is a subset of the Cartesain cross-product of the 
definition domains of the attributes (columns). Cartesian product being 
a commutative operation, "order of columns" does not really exists. Period.

If you impose an order relationship, you *add* inforation to the 
structure. That may be OK, but you can't rely on relational algebra to 
guarantee your results. You'll have to manage it yourself. (And, yes, 
there is relevant algebra for this, too ...).

</Nitpicking>

> Isn't it well known that it's not preferable to use
> 'select *','insert' without column list etc.. in production
> applications ?

100% agreed. Such a notation is an abbreviation. Handy, but dangerous. 
IMHO, such checking can (should ?) be done by an algorithm checking for 
column *names* before sending the "insert" command.

A partial workaround : inserting in a view containing only the relevant 
columns, in a suitable (and known) order.

[ Back to lurking ... ]



pgsql-hackers by date:

Previous
From: vs
Date:
Subject: LM devel GLIB2_2
Next
From: Thomas Lockhart
Date:
Subject: Re: Re: Beos update