Re: minor view creation weirdness

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: minor view creation weirdness
Дата
Msg-id 26846.1065104190@sss.pgh.pa.us
обсуждение исходный текст
Ответ на minor view creation weirdness  (Neil Conway <neilc@samurai.com>)
Ответы Re: minor view creation weirdness  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Is this a bug?

> nconway=# create view baz (a,b) as select 'hello', 'world';
> WARNING:  column "a" has type "unknown"
> DETAIL:  Proceeding with relation creation anyway.

It's always done that, although the spelling of the notice has
varied over the years.

These days we tend to force "unknown" to become "text" if a specific
data type is really required, and I suppose a case could be made that
CREATE VIEW should do that too.  But the consequences of guessing wrong
are probably worse here than elsewhere, since you can't really change
the view column type short of dropping and recreating the view.

I'd almost argue that we should change this message to an error:
ERROR: column "a" has type "unknown"HINT: Explicitly cast the string literal to some specific type.
        regards, tom lane


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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Thoughts on maintaining 7.3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Weird locking situation