Re: type money causes unrestorable dump - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: type money causes unrestorable dump
Date
Msg-id 87d4voceij.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: type money causes unrestorable dump  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: type money causes unrestorable dump
List pgsql-hackers
"D'Arcy J.M. Cain" <darcy@druid.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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Timezone database changes
Next
From: Magnus Hagander
Date:
Subject: Re: Skytools committed without hackers discussion/review