| От | Tom Lane |
|---|---|
| Тема | Re: SELECT CAST(123 AS char) -> 1 |
| Дата | |
| Msg-id | 20058.1203178531@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: SELECT CAST(123 AS char) -> 1 (Ken Johanson <pg-user@kensystem.com>) |
| Список | pgsql-general |
Ken Johanson <pg-user@kensystem.com> writes:
> Tom Lane wrote:
>> Hm, good point, so really we ought to have a separate casting path for
>> numeric types to char(n). However, this section still doesn't offer
>> any support for the OP's desire to auto-size the result; it says
>> that you get an error if the result doesn't fit in the declared
>> length:
>>
>>> iv) Otherwise, an exception condition is raised: data exception-
>>> string data, right truncation.
> I don't believe the size is being declared in the OP's (subject line)
> example: SELECT CAST(123 AS char)
No, because section 6.1 still defines what "char" means, and it says
that means "char(1)".
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера