Re: type money causes unrestorable dump

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: type money causes unrestorable dump
Date: 2007-10-09 18:46:28
Message-ID: 87d4voceij.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"D'Arcy J.M. Cain" <darcy(at)druid(dot)net> writes:

> That said, I wonder if there is another answer to this question.
> Perhaps the functions in cash.c can be pulled out and made into
> external functions that can be fed an int (long) and output the desired
> format. That way we could use the existing int or long type but
> convert manually on I/O. Let people choose whether they want the
> simplification of the money type or the standardization allowed by just
> using the functions.

Long term I liked the idea from a few years ago of having a "default format"
which would be attached to a column just like a default collation can be
attached. Then you can declare your currency columns as regular integers but
mark them as being formatted as currency by default.

pg_dump would presumably explicitly override the default and format the
integers as plain integers and restore the default format string as part of
its DDL.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2007-10-09 19:14:13 Re: Skytools committed without hackers discussion/review
Previous Message Kevin Grittner 2007-10-09 17:53:42 Re: Timezone database changes