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

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>, 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 11:06:09
Message-ID: 824ob7j80u.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Grzegorz Jaśkiewicz:

> 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.

This can't be true because several SQL features rely on deterministic
column order. Here's an example:

SELECT 1 AS a, 2 AS b UNION SELECT 3 AS b, 4 AS a;

a | b
---+---
1 | 2
3 | 4
(2 rows)

--
Florian Weimer <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2010-11-24 11:13:30 Re: alter table add column - specify where the column will go?
Previous Message Florian Weimer 2010-11-24 11:01:41 Streaming processing of result sets