Re: Inherits is not encouraged?

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Inherits is not encouraged?
Дата
Msg-id 20090310082313.GE3885@merkur.hilbert.loc
обсуждение исходный текст
Ответ на Re: Inherits is not encouraged?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
On Mon, Mar 09, 2009 at 07:55:35PM -0400, Tom Lane wrote:

> Emi Lu <emilu@encs.concordia.ca> writes:
> > (1) Is possible that I could change the column of a table that is 
> > defined by Inherits?
> 
> > e.g., t1(col1, col2, col3); create table tx(colx) Inherits (t1)
> > I'd like to get tx shown as (col1, colx, col2, col3).
> 
> No, you don't really have a lot of control over that.

"Explicit select list" would be one way (and the one that's
encouraged as good practice):
select col1, colx, col2, col3 from tx;

If that doesn't cut it (say, generic viewer which doesn't
know what is going to be viewed) - use a view over tx. Maybe
even "hide" the table tx as "table_tx" and name the view
itself "tx". Care needs to be taken then to either setup
appropriate rules or to make insert/update/delete go to
"table_tx".

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inherits is not encouraged?
Следующее
От: hidura@gmail.com
Дата:
Сообщение: Problem with an Empty Column