Re: alter table add column - specify where the column will go?

From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: alter table add column - specify where the column will go?
Date: 2010-11-24 10:45:23
Message-ID: AANLkTi=+WD=WKEq9Hnpz5cjqEBz+TkrxccyV_miMCrVY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It is easy to create view based on SELECT which explicitly specifies
the columns names. IMO it is better to hide tables structures behind views
and work with them, since views are not materialized and it is easy to drop
and recreate or just add another view into the database. With this approach
you can than SELECT * FROM my_view without care of physical ordinal
positions in a tables.

2010/11/24 Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>

> just never use SELECT *, but always call columns by names. You'll
> avoid having to depend on the order of columns, which is never
> guaranteed, even if the table on disk is one order, the return columns
> could be in some other.
>

--
// Dmitriy.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Gravsjö 2010-11-24 10:46:59 Re: alter table add column - specify where the column will go?
Previous Message AI Rumman 2010-11-24 10:38:48 FTS is taking "<!--" as a xml comment.