Re: How get column-wise table info from an arbitrary query? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: How get column-wise table info from an arbitrary query?
Date
Msg-id CAHyXU0xU2_zhA_NH2YL6AO32WVTo+fVAcymQCB2aW+5NMrZStg@mail.gmail.com
Whole thread Raw
In response to Re: How get column-wise table info from an arbitrary query?  (David Johnston <polobo@yahoo.com>)
List pgsql-general
On Tue, Jul 30, 2013 at 4:57 PM, David Johnston <polobo@yahoo.com> wrote:
> I'm in the "prefix the id column" camp.  I do not use "ORM" middle-ware so
> that may be a reason I do not have any difficulties but one of the big
> advantages to table-prefixing generic column names is that you can then make
> the assumption that any two columns with the same name represent the same
> data.  It does make "SELECT *" more useful when running interactive queries
> and, more importantly, it makes using NATURAL JOIN and USING (...) much
> easier - and I hate using ON (...) to perform a join (and I never use the
> "FROM a, b WHERE a = b" cartesian join construct).

I would say: most of all it completely defeats useful text searching.
Any ORM (or anything else) that enforces a primary key integer column
named 'id' is bad technology and should be avoided.  Schema should
define the 'object model' not the other way around; I'd estimate that
around 20-30% of my life's work has been cleaning up the various dreck
left around by those who fail to grasp that basic principle.

merlin


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: How get column-wise table info from an arbitrary query?
Next
From: Gavin Flower
Date:
Subject: Re: How get column-wise table info from an arbitrary query?