Re: [HACKERS] type money causes unrestorable dump

2007-11-04 Thread D'Arcy J.M. Cain
On Sat, 03 Nov 2007 15:47:40 -0400 Tom Lane [EMAIL PROTECTED] wrote: Greg's objection caused me to rethink that. Doing it would be a problem when transporting dump files across platforms: what if the appropriate locale name is spelled differently on the new machine? We should probably leave

Re: [HACKERS] type money causes unrestorable dump

2007-11-04 Thread Bruce Momjian
D'Arcy J.M. Cain wrote: + para +Since the output of this data type is locale-sensitive, it may not +work to load typemoney/ data into a database that has a different +setting of varnamelc_monetary/. To avoid problems, before +restoring a dump make sure varnamelc_monetary/

Re: [HACKERS] type money causes unrestorable dump

2007-11-04 Thread D'Arcy J.M. Cain
On Sun, 4 Nov 2007 17:24:10 -0500 (EST) Bruce Momjian [EMAIL PROTECTED] wrote: D'Arcy J.M. Cain wrote: + para +Since the output of this data type is locale-sensitive, it may not +work to load typemoney/ data into a database that has a different +setting of

Re: [HACKERS] type money causes unrestorable dump

2007-11-04 Thread Tom Lane
D'Arcy J.M. Cain [EMAIL PROTECTED] writes: Hmm. I think I like Tom's version better. However, since my primary goal here is to remove the deprecation I will let you guys duke it out over the additional clause. :-) Just pick the wording you like and commit it; we've spent more than enough

Re: [HACKERS] type money causes unrestorable dump

2007-11-04 Thread D'Arcy J.M. Cain
On Sun, 04 Nov 2007 20:38:11 -0500 Tom Lane [EMAIL PROTECTED] wrote: D'Arcy J.M. Cain [EMAIL PROTECTED] writes: Hmm. I think I like Tom's version better. However, since my primary goal here is to remove the deprecation I will let you guys duke it out over the additional clause. :-)

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread D'Arcy J.M. Cain
On Tue, 9 Oct 2007 13:16:08 -0400 D'Arcy J.M. Cain [EMAIL PROTECTED] wrote: On Tue, 9 Oct 2007 19:02:38 +0200 Peter Eisentraut [EMAIL PROTECTED] wrote: Am Dienstag, 9. Oktober 2007 schrieb D'Arcy J.M. Cain: +    Due to locale changes this type may have problems with dump and +    restore

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread Tom Lane
D'Arcy J.M. Cain [EMAIL PROTECTED] writes: I never received a response on this. Here is the full diff with the above change. Since it is documentation and not code, is it OK to commit this now? The added text needs some copy-editing, I think. How about Since the output of this data

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: A more direct approach to the problem might be to change pg_dump to set lc_monetary, as it does for client_encoding ... It should probably note that if the machine being restored onto has a different libc it could still not be restorable even with the correct

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread D'Arcy J.M. Cain
On Sat, 03 Nov 2007 14:39:48 -0400 Tom Lane [EMAIL PROTECTED] wrote: D'Arcy J.M. Cain [EMAIL PROTECTED] writes: I never received a response on this. Here is the full diff with the above change. Since it is documentation and not code, is it OK to commit this now? The added text needs

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread Tom Lane
D'Arcy J.M. Cain [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: A more direct approach to the problem might be to change pg_dump to set lc_monetary, as it does for client_encoding ... Certainly OK by me. Greg's objection caused me to rethink that. Doing it would be a problem

Re: [HACKERS] type money causes unrestorable dump

2007-11-03 Thread Peter Eisentraut
Tom Lane wrote: Doing it would be a problem when transporting dump files across platforms: what if the appropriate locale name is spelled differently on the new machine? The question is which is more likely? Using a dump on a similar platform with different locale settings is fairly common,

Re: [HACKERS] type money causes unrestorable dump

2007-10-10 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: 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

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread D'Arcy J.M. Cain
On Mon, 8 Oct 2007 20:02:56 -0700 Joshua D. Drake [EMAIL PROTECTED] wrote: The money data type has been deprecated for years. It is completely non standard and essentially duplicative of numeric/decimal. What is the point? It may be deprecated (maybe not) and it may have drawbacks but it is

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread Joshua D. Drake
On Tue, 9 Oct 2007 11:26:16 -0400 D'Arcy J.M. Cain [EMAIL PROTECTED] wrote: On Mon, 8 Oct 2007 20:02:56 -0700 Joshua D. Drake [EMAIL PROTECTED] wrote: The money data type has been deprecated for years. It is completely non standard and essentially duplicative of numeric/decimal. What is

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread D'Arcy J.M. Cain
[Note: Cc list trimmed as everyone is probably on the list anyway] On Tue, 9 Oct 2007 09:02:09 -0700 Joshua D. Drake [EMAIL PROTECTED] wrote: However, keep in mind that I really don't care if Money is deprecated or not. I do care that the docs say it is, and it may not be. :) Understood.

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread Peter Eisentraut
Am Dienstag, 9. Oktober 2007 schrieb D'Arcy J.M. Cain: +    Due to locale changes this type may have problems with dump and +    restore and care should be taken. With respect, this kind of advice is useless. What are the problems, when do they occur, and what should be done about them? We

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread D'Arcy J.M. Cain
On Tue, 9 Oct 2007 19:02:38 +0200 Peter Eisentraut [EMAIL PROTECTED] wrote: Am Dienstag, 9. Oktober 2007 schrieb D'Arcy J.M. Cain: +    Due to locale changes this type may have problems with dump and +    restore and care should be taken. With respect, this kind of advice is useless. What

Re: [HACKERS] type money causes unrestorable dump

2007-10-09 Thread Gregory Stark
D'Arcy J.M. Cain [EMAIL PROTECTED] 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

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Bruce Momjian
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I noticed that if you create a dump on a database containing a money column and a certain locale, this dump is not restorable on a database with a different locale. We've been through this, no? If money doesn't print that way,

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Bruce Momjian
Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:31:31 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I noticed that if you create a dump on a database containing a money column and a certain

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Bruce Momjian
Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:42:57 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:31:31 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: dering

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Joshua D. Drake
On Mon, 8 Oct 2007 22:42:57 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:31:31 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: dering money is deprecated, is this really needed? We have other MONEY

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Joshua D. Drake
On Mon, 8 Oct 2007 22:31:31 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I noticed that if you create a dump on a database containing a money column and a certain locale, this dump is not restorable on a database with a

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Joshua D. Drake
On Mon, 8 Oct 2007 22:52:23 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:42:57 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8

Re: [HACKERS] type money causes unrestorable dump

2007-10-08 Thread Joshua D. Drake
On Mon, 8 Oct 2007 20:02:56 -0700 Joshua D. Drake [EMAIL PROTECTED] wrote: On Mon, 8 Oct 2007 22:52:23 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED] wrote: Joshua D. Drake wrote: -- Start of PGP signed section. On Mon, 8 Oct 2007 22:42:57 -0400 (EDT) Bruce Momjian [EMAIL PROTECTED]

[HACKERS] type money causes unrestorable dump

2007-10-04 Thread Alvaro Herrera
I noticed that if you create a dump on a database containing a money column and a certain locale, this dump is not restorable on a database with a different locale. Most notably, I tried dumping the regression database (which is created with --locale=C), and then importing it into a database of

Re: [HACKERS] type money causes unrestorable dump

2007-10-04 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I noticed that if you create a dump on a database containing a money column and a certain locale, this dump is not restorable on a database with a different locale. We've been through this, no? Hmm, true. I even replied to the

Re: [HACKERS] type money causes unrestorable dump

2007-10-04 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I noticed that if you create a dump on a database containing a money column and a certain locale, this dump is not restorable on a database with a different locale. We've been through this, no? If money doesn't print that way, there's no obvious reason