Re: migrating from mysql: need to convert empty string to null
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: migrating from mysql: need to convert empty string to null |
| Дата | |
| Msg-id | 1302.1213814372@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | migrating from mysql: need to convert empty string to null ("Dave Lee" <davelee.com@gmail.com>) |
| Ответы |
Re: migrating from mysql: need to convert empty string to null
|
| Список | pgsql-general |
"Dave Lee" <davelee.com@gmail.com> writes:
> and I notice that there isn't any rows specified for converting
> varchar or text to int. Which raises the question, if I run:
> SELECT '123'::int;
> What conversion is actually happening here?
None. There is no type coercion there --- what that is really
specifying is invocation of the int data type's input function
on the given string.
I don't think your approach is going to work; you would have to
make your client programs emit things like
insert into mytab(integercol) values (''::varchar)
in order to get a runtime varchar-to-int cast to be applied.
At that point you might as well fix them properly.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера