Re: The Tomb of the Unknown Type?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: The Tomb of the Unknown Type?
Дата
Msg-id 21118.1081487105@sss.pgh.pa.us
обсуждение исходный текст
Ответ на The Tomb of the Unknown Type?  (Chris Browne <cbbrowne@acm.org>)
Список pgsql-hackers
Chris Browne <cbbrowne@acm.org> writes:
> We have encountered a pretty oddball situation involving an "unknown" type.

The way you get this sort of thing is with

CREATE VIEW foo AS SELECT ... , 'literal', ...

The undecorated literal is initially of type UNKNOWN, and there's
nothing to cause it to get coerced to some more-specific type, so
UNKNOWN ends up actually showing in the view's column type.  The
CREATE command will bleat ineffectually about this, but create the
view anyway.

The cure is to cast the literal to some specific type when you
do the CREATE.

One could perhaps argue that we should default to assuming that TEXT
type was meant, as we do in some similar cases such as UNION.  But
it's not done at the moment.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL configuration
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Small suggestion on build script