Re: [GENERAL] Change server encoding after the fact

2011-10-01 Thread Cody Caughlan
Thanks y'all for your help on this. I took this opportunity to upgrade to 9.1.1 which is UTF8 by default and I ended up manually cleaning up the borked data by hand (there wasn't that much). So all is well now. Thanks again. /Cody On Fri, Sep 30, 2011 at 3:37 PM, Scott Marlowe wrote: > On F

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 2:57 PM, Cody Caughlan wrote: > Please see below. > > On Fri, Sep 30, 2011 at 1:12 PM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: >> > That worked, but "file" shows no difference: >> > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Please see below. On Fri, Sep 30, 2011 at 1:12 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: > > That worked, but "file" shows no difference: > > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql > > $ file -i foo.sql > > foo.sql: text/plain; charset=us-ascii > >

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: > That worked, but "file" shows no difference: > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql > $ file -i foo.sql > foo.sql: text/plain; charset=us-ascii > $file -i utf.sql > utf.sql: text/plain; charset=us-ascii > So iconv didnt actually con

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:41 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:39 PM, Cody Caughlan wrote: >> Its a Rails app and I do have: >>   encoding: utf8 > > > Hmmm, if you try this does it work (mostly)? > > iconv -f utf-8 -t utf-8 -c < infile > outfile If that doesn't work try: icon

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
That worked, but "file" shows no difference: $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql $ file -i foo.sql foo.sql: text/plain; charset=us-ascii $file -i utf.sql utf.sql: text/plain; charset=us-ascii So iconv didnt actually convert the file OR does is the "file" command just ignorant? On Fri

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:39 PM, Cody Caughlan wrote: > Its a Rails app and I do have: >   encoding: utf8 Hmmm, if you try this does it work (mostly)? iconv -f utf-8 -t utf-8 -c < infile > outfile -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your su

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Its a Rails app and I do have: encoding: utf8 Set in my DB configuration. On Fri, Sep 30, 2011 at 12:38 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:35 PM, Cody Caughlan wrote: > > > > > > On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:35 PM, Cody Caughlan wrote: > > > On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: >> > Please see below. >> > >> > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe >> > >> > wrote: >> >> >> >> On Fri,

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: > > Please see below. > > > > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan > wrote: > >> > Thanks Scott. See

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Tom Lane
Cody Caughlan writes: > Ok, I see what you mean. This would create a new DB with the proper > encoding. Which is "fine", and probably what I will do. I guess I see an > ideal scenario being one where we permanently convert the template encoding > to UTF8 so going forward I dont have to worry about

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: > Please see below. > > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: >> > Thanks Scott. See below: >> > >> > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe >> > >> >

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Please see below. On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: > > Thanks Scott. See below: > > > > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan > wrote:

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Tom Lane
Scott Marlowe writes: > On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: >> So it appears both template0 & template1 are SQL_ASCII, so how would >> creating from a new DB from template0 be any different than template1? > P.s. I'm not sure why it works, I just know that it does. :) CREATE

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: > Thanks Scott. See below: > > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: >> > I would like to change my server_encoding which is currently SQL_ASCII >> > to UTF8. >>

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Thanks Scott. See below: On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: > > I would like to change my server_encoding which is currently SQL_ASCII to > UTF8. > > > > I have existing data that I would like to keep. > > > > From my u

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: > I would like to change my server_encoding which is currently SQL_ASCII to > UTF8. > > I have existing data that I would like to keep. > > From my understanding of the steps I need to: > > 1) alter the template1 database encoding via > > UPD