Re: Selecting a constant question: A summary

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Selecting a constant question: A summary
Дата
Msg-id 87myz4ci1v.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Selecting a constant question: A summary  ("Chuck McDevitt" <cmcdevitt@greenplum.com>)
Список pgsql-hackers
"Chuck McDevitt" <cmcdevitt@greenplum.com> writes:

> Just a curiosity question:  Why is the type of a literal '1' "unknown"
> instead of varchar(1)?

Even if it was assigned a text datatype it would be the unconstrainted "text"
not varchar(1). If we used varchar(1) then things like:
create table foo as select 'foo';

would create a table with varchar(3) which would then complain if you tried to
insert 'foobar' into. There doesn't seem to be enough evidence that the user
intended to constrain the input to just 'foo' in that case.

Of course right now you get a table with a column of type "unknown" which is
very unlikely to be what the user expects.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



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

Предыдущее
От: Dave Page
Дата:
Сообщение: EXPLAIN omits schema?
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: comparing index columns