Re: problems importing from csv

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: problems importing from csv
Дата
Msg-id CAHOFxGpHx8fPu-hJ9Qtimppc8LQisaUEYsYBcLKiYTU1=UO8Hg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: problems importing from csv  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
>I am trying to import some data from spreadsheets. Included in the data
>sets are US monetary values. These appear in the CSV file, like this: $1.00
>The column is defined like this: NUMERIC(5,2) NOT NULL.

1) remove all $ characters from csv before import
OR
2) import into text field (perhaps in a temp table), remove $ characters, cast value and insert into numeric field

By the way, there may be no benefit to specifying a max value of 99,999.99 if you can foresee a potential need for bigger values. For values that fit, numeric(1000,2) will store numbers in the same bytes as a numeric(5,2) field will. It just won't throw an error if large values are used in the future.

В списке pgsql-general по дате отправления:

Предыдущее
От: rob stone
Дата:
Сообщение: Re: PGPASSWORD in crypted form, for example BlowFish or SHA-256
Следующее
От: stan
Дата:
Сообщение: Re: FW: Re: FW: Re: Shouldn;t this trigger be called?