Re: Turn off "money" formatting? - Mailing list pgsql-general

From Brendan Jurd
Subject Re: Turn off "money" formatting?
Date
Msg-id 40C3A2B1.6040903@blakjak.sytes.net
Whole thread Raw
In response to Turn off "money" formatting?  (jerry.levan@eku.edu (Jerry))
List pgsql-general
If you need to be able to cast money to numeric, you can just write your
own cast.  This is one of the things about postgres that I dearly love.

You could probably even write the cast function in SQL using regular
expressions.

Then, you just write a query with an explicit cast, e.g. SELECT foo ::
numeric FROM bar;

I noticed in the docs that the money type is actually deprecated, so you
probably want to consider converting your column to the numeric type
regardless.

BJ

Jerry wrote:

>Is it possible to turn off the "$" and "," that appear in "money" formatted
>columns so I can dump the table in a numeric format?
>
>The man page hints that lc_monetary controls the formatting but I
>cannot find any clues on what to do...
>
>Apparently money cannot be cast to anything.
>
>I don't think it will be hard to write a custom tcl/perl
>script that takes a "copy checks to...."  command to do the task
>but I would like a cleaner solution....
>
>
>Jerry
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>

pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Check for prepared statement
Next
From: Tom Lane
Date:
Subject: Re: Dropping schemas and "illegal seek"