char/varchar truncation

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема char/varchar truncation
Дата
Msg-id 20020802194318.C46821-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответы Re: char/varchar truncation
Список pgsql-hackers
I wonder if we actually did the right thing with this.

For example:select cast('ab' as char(1));

Using sql92's definitions, I read TD as
a fixed length character string and
SD as the same.

Which means I think the section that
comes into play is:

SQL92 6.10 GR5 c ii
ii) If the length in characters of SV is larger than LTD, then    TV is the first LTD characters of SV. If any of the
re-   maining characters of SV are non-<space> characters, then a    completion condition is raised: warning-string
data,right    truncation.
 

It looks like SQL99's cast specification is similar for this
case.

Wouldn't that mean the operation is supposed to succeed with
diagnostic information since it's a completion condition not
an exception condition?



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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: FUNC_MAX_ARGS benchmarks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FUNC_MAX_ARGS benchmarks