| От | Tom Lane |
|---|---|
| Тема | Re: custom type similar to varchar(#) |
| Дата | |
| Msg-id | 14717.1028318082@sss.pgh.pa.us обсуждение |
| Ответ на | custom type similar to varchar(#) (Jeff Davis <list-pgsql-general@empires.org>) |
| Список | pgsql-general |
Jeff Davis <list-pgsql-general@empires.org> writes:
> I would like to try to emulate the behavior of the old style varchar(#), in
> which it automatically truncated values that were oversized. To do this, it
> occured to me to try making a custom type, but for that I would need to
> accept the numerical argument as part of the type. I could not find any way
> in the documentation to create such a type.
varchar and other types with special syntax require special processing
in the parser. If you're not afraid of yacc grammars then you could
hack up gram.y to add another special type name. On the whole, though,
you might prefer to go and revert the change in the varchar limit-check
routine ...
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера