Re: Extracting data from deprecated MONEY fields
Вложения
В списке pgsql-general по дате отправления:
| От | Tino Wildenhain |
|---|---|
| Тема | Re: Extracting data from deprecated MONEY fields |
| Дата | |
| Msg-id | 484A79AF.9010301@wildenhain.de обсуждение исходный текст |
| Ответ на | Re: Extracting data from deprecated MONEY fields (Tino Wildenhain <tino@wildenhain.de>) |
| Ответы |
Re: Extracting data from deprecated MONEY fields
|
| Список | pgsql-general |
Hi, Tino Wildenhain wrote: > Hi, > > Shane Ambler wrote: > ... >> I think the steps Joshua is referring to are - >> >> 1. pg_dump -t mytable_with_money mydb > mytable_backup.sql >> 2. edit table definition in backup file to use numeric >> 3. remove $ and , from money column data >> 4. DROP TABLE mytable_with_money >> 5. psql < mytable_backup.sql >> >> While the data is in a text file regex tasks to remove the money >> formatting become a lot simpler. > > to_char() and back to numeric shouldn't be a problem within the database > and we have regex too if anything fails. I don't think you need to > dump and edit the dump to achive that. Ah sorry forget that... neither to_char nor cast to text works. Really a horrible datatype :( Tino
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера