Thread: Import German Number Format
Hello, I have to import a huge number of data sets of data sets with "Copy from". The numbers are formatted with decimal comma ',' (as usual in Germany) instead of the decimal point '.' When I try to import this data Postgres crashes, so I think I have to change a parameter with SET? Does anybody know which parameter I have to change? Tim --
am Thu, dem 02.10.2008, um 15:35:44 +0200 mailte Tim Semmelhaack folgendes: > Hello, > > I have to import a huge number of data sets of data sets with "Copy from". > > The numbers are formatted with decimal comma ',' (as usual in Germany) > instead of the decimal point '.' > > When I try to import this data Postgres crashes, so I think I have to PostgreSQL crashed? I disbelieve this, you got an error, right? > change a parameter with SET? Does anybody know which parameter I have > to change? There isn't such a parameter. Change your data, change the ',' to '.'. Or load the data into a temp. table as text and use build-in-functions to convert this text to numeric and fill your destination table. I would use sed or such tools. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
On Thu, Oct 2, 2008 at 9:35 AM, Tim Semmelhaack <semmelhaack@gmail.com> wrote: > The numbers are formatted with decimal comma ',' (as usual in Germany) > instead of the decimal point '.' > > When I try to import this data Postgres crashes, so I think I have to > change a parameter with SET? Does anybody know which parameter I have > to change? Independent of locale-related settings, I don't believe PG will accept a comma as input in this case. -- Jonah H. Harris, Senior DBA myYearbook.com
On Thursday 2. October 2008, Tim Semmelhaack wrote: >Hello, > >I have to import a huge number of data sets of data sets with "Copy > from". > >The numbers are formatted with decimal comma ',' (as usual in Germany) >instead of the decimal point '.' > >When I try to import this data Postgres crashes, so I think I have to >change a parameter with SET? Does anybody know which parameter I have >to change? s/(\d{2}),(\d{2}),(\d{4})/$1.$2.$3/g -- Leif Biberg Kristensen | Registered Linux User #338009 Me And My Database: http://solumslekt.org/blog/