Re: allowing ',' (comma) in float8

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: stig erikson <stigerikson_nospam_(at)yahoo(dot)se>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: allowing ',' (comma) in float8
Date: 2005-06-19 12:25:45
Message-ID: 20050619122545.GA32482@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, Jun 12, 2005 at 12:17:12 +0200,
stig erikson <stigerikson_nospam_(at)yahoo(dot)se> wrote:
> hi.
> is it possible to use flort values with a comma as decimal placeholder?
>
> i am trying to use copy to insert a table, the table contains a few columns
> with numerical values such as price, the vales are given on the format
> "2345,12", postgresql seems to allow only "2345.12".
>
> can i change the behavior on postgresql to allow ',' as decimal placeholder?
>
> postgresql 7.4.6

It looks like you can probably use to_number to convert the input string
to numeric if ',' is the decimal separator in the locale you are using.
You can then cast the numeric value to float.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-06-19 12:34:33 Re: Storing an array to Postgresql table
Previous Message Oleg Bartunov 2005-06-19 08:48:12 Re: [SQL] Set Membership operator -- test group membership