| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: Type cast text to int4 |
| Дата | |
| Msg-id | 20070907102954.GC23630@svana.org обсуждение исходный текст |
| Ответ на | Type cast text to int4 ("M. van Egmond" <mvanegmond@quetalzorg.nl>) |
| Ответы |
Re: Type cast text to int4
|
| Список | pgsql-general |
On Fri, Sep 07, 2007 at 11:36:23AM +0200, M. van Egmond wrote: > Hello everybody, > > Im having troubles overriding postgresql's default behaviour of throwing > an error while trying to cast an empty string to int4. I would like to > cast empty strings to a null integer value. I've tried this by creating > my own domain: Your problem is that ''::myint does not call your cast function, it calls the input function for your basetype, which a domain can't override. Your options are to actually make a new basetype, which isn't too hard. Or, you can use ''::text::myint which probably will call your cast function. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера