Re: Casting to money

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Shane Ambler" <pgsql(at)007Marketing(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Casting to money
Date: 2006-10-09 09:10:13
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E40176D39B@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Shane Ambler
> Sent: 09 October 2006 09:06
> To: PostgreSQL Hackers
> Subject: Re: [HACKERS] Casting to money
>
> Tom Lane wrote:
> > "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
> >> select '$123.45'::money
> >> ERROR: invalid input syntax for type money: "$123.45"
> >> select '£123.00'::money
> >> ERROR: invalid input syntax for type money: "£123.00"
> >
> > So ... what locale are you trying this in?
> >
> I get the following from 8.2beta1 - looks like it doesn't like the
> double quotes.

Double quotes are used for object names - "MySchema"."MyTable" for example. I didn't even bother testing them.

> postgres=# select '123.45'::money;
> money
> ---------
> $123.45
> (1 row)

Now that's interesting - on the Windows server, pgAdmin gets a blank string back. On further investigation, this is looking like an encoding issue in which pgAdmin (well, wxWidgets) isn't converting the £ to utf-8 and back correctly. It does appear to be working correctly in psql.

Sorry for the noise.

Regards, Dave.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2006-10-09 10:24:28 Fwd: pg_dump VS alter database ... set search_path ...
Previous Message Nikolay Samokhvalov 2006-10-09 08:45:16 pg_dump VS alter database ... set search_path ...