Re: How get column-wise table info from an arbitrary query?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: How get column-wise table info from an arbitrary query?
Дата
Msg-id CAHyXU0xU2_zhA_NH2YL6AO32WVTo+fVAcymQCB2aW+5NMrZStg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How get column-wise table info from an arbitrary query?  (David Johnston <polobo@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: How get column-wise table info from an arbitrary query?
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: How get column-wise table info from an arbitrary query?