Re: CAST truncates without warning

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CAST truncates without warning
Дата
Msg-id 12704.1084488635@sss.pgh.pa.us
обсуждение исходный текст
Ответ на CAST truncates without warning  (Mike G <mike@thegodshalls.com>)
Список pgsql-general
Mike G <mike@thegodshalls.com> writes:
> If a column, data type text, with 22 characters of data, is then CAST(column_name as varchar(20)) shouldn't a warning
orerror be generated? 

No.  This is per SQL spec.

You will get a warning if you assign the value to a varchar(20) table
column *without* any explicit cast.  This is also per SQL spec.

            regards, tom lane

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

Предыдущее
От: Mike G
Дата:
Сообщение: CAST truncates without warning
Следующее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: pg_xlog becomes extremely large during CREATE INDEX