Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Alvaro Herrera
Tom Lane wrote: > Martijn van Oosterhout writes: > > And as a counter-example: pg_dump should absolutly not use the client > > locale, it should always dump as the same encoding as the server... > > Sure, but pg_dump should set that explicitly. I'm prepared to believe > that looking at the local

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Tom Lane
Martijn van Oosterhout writes: > And as a counter-example: pg_dump should absolutly not use the client > locale, it should always dump as the same encoding as the server... Sure, but pg_dump should set that explicitly. I'm prepared to believe that looking at the locale is sane for all normal cli

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Martijn van Oosterhout
On Fri, Aug 25, 2006 at 08:13:39PM +0200, Peter Eisentraut wrote: > > I agree with Martijn that putting these into libpq's API > > seems like useless clutter. > > Where else to put it? We need it in libpq anyway if we want this > behavior in all client applications (by default). Is that so? I

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I agree with Martijn that putting these into libpq's API >> seems like useless clutter. > Where else to put it? We need it in libpq anyway if we want this > behavior in all client applications (by default). Having the code in li

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Peter Eisentraut
Tom Lane wrote: > Um, but initdb doesn't use libpq, so it's going to need its own copy > anyway. initdb certainly links against libpq. > I agree with Martijn that putting these into libpq's API > seems like useless clutter. Where else to put it? We need it in libpq anyway if we want this beha

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Am Freitag, 25. August 2006 17:30 schrieb Martijn van Oosterhout: >> Umm, why export all these functions. For starters, does this even need >> to be in libpq? > Where else would you put it? > ... > initdb has different requirements. Let me know if yo

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Martijn van Oosterhout
On Fri, Aug 25, 2006 at 05:38:20PM +0200, Peter Eisentraut wrote: > > In fact, the only thing you need is PQsetClientEncodingFromLocale(), > > anything else is just sugar. Why would the user care about what the OS > > calls it? We have a "pg_enc" enum, so lets use it. > > initdb has different requ

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Peter Eisentraut
Am Freitag, 25. August 2006 17:30 schrieb Martijn van Oosterhout: > Umm, why export all these functions. For starters, does this even need > to be in libpq? Where else would you put it? > In fact, the only thing you need is PQsetClientEncodingFromLocale(), > anything else is just sugar. Why would

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Martijn van Oosterhout
On Fri, Aug 25, 2006 at 05:07:03PM +0200, Peter Eisentraut wrote: > I got started on this and just wanted to post an intermediate patch. I have > taken the logic from initdb and placed it into libpq and refined the API a > bit. At this point, there should be no behaviorial change. It remains t

Re: [HACKERS] [GENERAL] invalid byte sequence ?

2006-08-25 Thread Peter Eisentraut
Am Donnerstag, 24. August 2006 00:52 schrieb Tom Lane: > A possible solution therefore is to have psql or libpq drive the > client_encoding off the client's locale environment instead of letting > it default to equal the server_encoding. I got started on this and just wanted to post an intermediat