Re: [GENERAL] replacing a view: bug or feature?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] replacing a view: bug or feature?
Дата
Msg-id 25431.1102832866@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
"Ed L." <pgsql@bluepolka.net> writes:
> CREATE TABLE foo ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
> CREATE TABLE bar ( "key" serial NOT NULL PRIMARY KEY, msg character(100));
> CREATE VIEW baz AS SELECT * FROM foo UNION ALL SELECT * FROM bar;
> CREATE OR REPLACE VIEW baz AS SELECT * FROM foo;
> psql:foo.sql:6: ERROR:  cannot change data type of view column "msg"

The bottom-line issue here is that a UNION sets the typmod of its output
columns to -1, even when the inputs all share the same type OID and
typmod.  We changed that behavior some time ago for JOIN columns, and
probably ought to do the same for UNION columns.

I think this requires only a minor change in parser/analyze.c's
transformSetOperationStmt() ... any objections?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [Testperf-general] Re: 8.0beta5 results w/ dbt2
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [Testperf-general] Re: 8.0beta5 results w/ dbt2