Re: alter table add column - specify where the column will go? - Mailing list pgsql-general

From Dmitriy Igrishin
Subject Re: alter table add column - specify where the column will go?
Date
Msg-id AANLkTi=+WD=WKEq9Hnpz5cjqEBz+TkrxccyV_miMCrVY@mail.gmail.com
Whole thread Raw
In response to Re: alter table add column - specify where the column will go?  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
List 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@gmail.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.


pgsql-general by date:

Previous
From: AI Rumman
Date:
Subject: FTS is taking "
Get in touch!



© Postgres Professional Europe Limited, 2015 — 2024
EULA EULA for Cloud Environments Privacy Policy GDPR Compliance Commitment
© Postgres Professional Europe Limited, 2015 — 2024
EULA
EULA for Cloud Environments
Privacy Policy
GDPR Compliance Commitment