Restore SQL_ASCII backup...

Hi all,

I'm trying to restore an old backup (7.1.4) into a new PG database (8.4). T=
here are errors with some of the RI and sequences, but those are easy to fi=
x.

The problem is that one table in the DB has TEXT fields in it and these see=
m to be sensitive to the DB encoding. The default in the days of 7.1.4 was =
SQL_ASCII. The new default is UTF-8. pg_restore won't load the old table da=
ta into the new table.

I tried creating a new DB with encoding SQL_ASCII and restoring the backup =
into that, but I get the error:

pg_restore: [archiver (db)] COPY failed: ERROR: literal carriage return fo=
und in data
HINT: Use "\r" to represent carriage return.
CONTEXT: COPY encounters, line 9711: ""
WARNING: errors ignored on restore: 1
tarka [at] jetty:~$ psql -d triagedb
psql (8.4.1)
Type "help" for help.

The other problem is that the backups are in compressed format because I ne=
eded to save space on that system, so I can't just edit the text of the dat=
a directly.

What should I do at this point? Try to create an install of an old version =
of PG and restore into that?

Thanx in advance,

Brian


--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Brian Myers [ Mi, 02 Dezember 2009 07:34 ] [ ID #2024581 ]

Re: Restore SQL_ASCII backup...

Le mercredi 2 d=E9cembre 2009 =E0 07:34:09, Brian Myers a =E9crit :
> Hi all,
>
> I'm trying to restore an old backup (7.1.4) into a new PG database (8.4).
> There are errors with some of the RI and sequences, but those are easy to
> fix.
>
> The problem is that one table in the DB has TEXT fields in it and these
> seem to be sensitive to the DB encoding. The default in the days of 7.1.4
> was SQL_ASCII. The new default is UTF-8. pg_restore won't load the old
> table data into the new table.
>
> I tried creating a new DB with encoding SQL_ASCII and restoring the backup
> into that, but I get the error:
>
> pg_restore: [archiver (db)] COPY failed: ERROR: literal carriage return
> found in data HINT: Use "\r" to represent carriage return.
> CONTEXT: COPY encounters, line 9711: ""
> WARNING: errors ignored on restore: 1
> tarka [at] jetty:~$ psql -d triagedb
> psql (8.4.1)
> Type "help" for help.
>
> The other problem is that the backups are in compressed format because I
> needed to save space on that system, so I can't just edit the text of the
> data directly.
>

You still can get it:

pg_restore backup > backup.sql

will give you the SQL script.


--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Guillaume Lelarge [ Mi, 02 Dezember 2009 09:02 ] [ ID #2024583 ]
Datenbanken » gmane.comp.db.postgresql.admin » Restore SQL_ASCII backup...

Vorheriges Thema: pg_restore does not restore all tables
Nächstes Thema: Postgres Dump out of order