Re: [PATCHES] [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-07-10 Thread Bruce Momjian

Add pg_dump --encoding.

Patch applied.  Thanks.

---


Magnus Hagander wrote:
> > > I *think* that's easy enough to do in time for 8.1. Trivial patch 
> > > attached. I hope it's enough :-) It passed my very quick testing...
> > > 
> > > (Yup, I read the mails aobut PGCLIENTENCODING, but an option to 
> > > pg_dump is certainly easier)
> > 
> > You forgot to document the long option, I think.


-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread laser

I support to add the option, for I've been seeing too many of
our client got 'bad' dump just because they don't set PGCLIENTENCODING
correctly, (mostly because they use UTF8 as database encoding
but use some other encoding, like GBK as client encoding, but some
words break the autoconversion at present version and set
PGCLIENTENCODING to UTF8 would fix the problem).
Adding such a switch would remind DBAs there exists some encoding
conversion. In fact, I even think that we should use database encoding
to dump data regardless the PGCLIENTENCODING setting (unless
the user set the --encoding switch explicit), but I think
that might be break someone's application somewhere. :(

regards laser

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Michael Paesold

Alvaro Herrera wrote:



On Tue, Jun 28, 2005 at 10:24:19PM +0200, Magnus Hagander wrote:


I *think* that's easy enough to do in time for 8.1. Trivial patch
attached. I hope it's enough :-) It passed my very quick testing...

(Yup, I read the mails aobut PGCLIENTENCODING, but an option to pg_dump
is certainly easier)


You forgot to document the long option, I think.


Are the man pages generated from the sgml docs? Have never had a look at 
that.


Best Regards,
Michael Paesold 



---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Magnus Hagander
> >> I *think* that's easy enough to do in time for 8.1. Trivial patch 
> >> attached. I hope it's enough :-) It passed my very quick testing...
> >>
> >> (Yup, I read the mails aobut PGCLIENTENCODING, but an option to 
> >> pg_dump is certainly easier)
> >
> > You forgot to document the long option, I think.
> 
> Are the man pages generated from the sgml docs? Have never 
> had a look at that.

Yes - using docbook2man.

//Magnus

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Magnus Hagander
> > I *think* that's easy enough to do in time for 8.1. Trivial patch 
> > attached. I hope it's enough :-) It passed my very quick testing...
> > 
> > (Yup, I read the mails aobut PGCLIENTENCODING, but an option to 
> > pg_dump is certainly easier)
> 
> You forgot to document the long option, I think.

Oops. Fixed. Thanks.

//Magnus


pg_dump.sgml.diff
Description: pg_dump.sgml.diff

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Alvaro Herrera
On Tue, Jun 28, 2005 at 10:24:19PM +0200, Magnus Hagander wrote:

> I *think* that's easy enough to do in time for 8.1. Trivial patch
> attached. I hope it's enough :-) It passed my very quick testing...
> 
> (Yup, I read the mails aobut PGCLIENTENCODING, but an option to pg_dump
> is certainly easier)

You forgot to document the long option, I think.

-- 
Alvaro Herrera ()
"No necesitamos banderas
 No reconocemos fronteras"  (Jorge González)

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Magnus Hagander
> There's no time to do this for 8.1, but I'd like to get it on 
> the books for
> 8.2:
> 
> The Problem:  Occassionally a DBA needs to dump a database to a new 
> encoding.   In instances where the current encoding, (or lack of an 
> encoding, like SQL_ASCII) is poorly supported on the target 
> database server, it can be useful to dump into a particular 
> encoding.  But, currently the only way to set the encoding of 
> a pg_dump file is to change 
> client_encoding in postgresql.conf and restart postmaster.   
> This is more 
> than a little awkward for production systems.
> 
> The TODO:  add an --encoding=[encoding name] option to 
> pg_dump.  This would set client_encoding for pg_dump's session(s).

I *think* that's easy enough to do in time for 8.1. Trivial patch
attached. I hope it's enough :-) It passed my very quick testing...

(Yup, I read the mails aobut PGCLIENTENCODING, but an option to pg_dump
is certainly easier)

//Magnus


pg_dump.diff
Description: pg_dump.diff


pg_dump.sgml.diff
Description: pg_dump.sgml.diff

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Peter Eisentraut
Josh Berkus wrote:
> currently the only way to set the encoding of a pg_dump file is to
> change client_encoding in postgresql.conf and restart postmaster.  

Another way is to set the environment variable PGCLIENTENCODING.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Kris Jurka


On Tue, 28 Jun 2005, Josh Berkus wrote:

> The TODO:  add an --encoding=[encoding name] option to pg_dump.  This would 
> set client_encoding for pg_dump's session(s).
> 

What about just using the PGCLIENTENCODING environment variable?

Kris Jurka

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[HACKERS] Proposed TODO: --encoding option for pg_dump

2005-06-28 Thread Josh Berkus
Folks,

There's no time to do this for 8.1, but I'd like to get it on the books for 
8.2:

The Problem:  Occassionally a DBA needs to dump a database to a new 
encoding.   In instances where the current encoding, (or lack of an 
encoding, like SQL_ASCII) is poorly supported on the target database 
server, it can be useful to dump into a particular encoding.  But, 
currently the only way to set the encoding of a pg_dump file is to change 
client_encoding in postgresql.conf and restart postmaster.   This is more 
than a little awkward for production systems.

The TODO:  add an --encoding=[encoding name] option to pg_dump.  This would 
set client_encoding for pg_dump's session(s).

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster