pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Invalid UTF8  & Large Objects
3+ messages / 2 participants
[nested] [flat]

* Invalid UTF8  & Large Objects
@ 2006-04-25 20:17 Prasanth <dbadmin@nqadmin.com>
  2006-04-26 04:55 ` Re: Invalid UTF8  & Large Objects John DeSoi <desoi@pgedit.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Prasanth @ 2006-04-25 20:17 UTC (permalink / raw)
  To: pgsql-admin

Hi,

We recently migrated from 7.4.7 to 8.1.3. I did a pg_dumpall & then
pg_restore and it went fine.

Today I realized that the backups I am creating can't be used to reload
my database.
I use pg_dump -Fc to dump the database as I have Large Objects in the
database.

(I used to use pg_dump -b -Fc in 7.4.7 seems like the -b option is taken
out in 8.1.3 so I assume they are included automatically)

I get the error "ERROR:  invalid UTF-8 byte sequence detected........."

Did research online and fund out that it is because of invalid
characters in the database so started trying out the solution mentioned
in the posts that is by using iconv.

But then my problem is I have to do a text dump to use iconv in which
case I will loose the large objects.
I tried using the iconv on the dump generated using the -Fc option and
then when I try to restore that  I am getting the following error
pg_restore: [archiver] entry ID 0 out of range -- perhaps a corrupt TOC

Any help will be appreciated.

Thanks,
-Prasanth.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Invalid UTF8  & Large Objects
  2006-04-25 20:17 Invalid UTF8  & Large Objects Prasanth <dbadmin@nqadmin.com>
@ 2006-04-26 04:55 ` John DeSoi <desoi@pgedit.com>
  2006-04-26 15:01   ` Re: Invalid UTF8  & Large Objects Prasanth <dbadmin@nqadmin.com>
  0 siblings, 1 reply; 3+ messages in thread

From: John DeSoi @ 2006-04-26 04:55 UTC (permalink / raw)
  To: dbadmin@nqadmin.com; +Cc: pgsql-admin


On Apr 25, 2006, at 4:17 PM, Prasanth wrote:

> But then my problem is I have to do a text dump to use iconv in which
> case I will loose the large objects.
> I tried using the iconv on the dump generated using the -Fc option and
> then when I try to restore that  I am getting the following error
> pg_restore: [archiver] entry ID 0 out of range -- perhaps a corrupt  
> TOC

-Fc produces a binary format, so you can't use iconv on it. One  
option might be to write a script to export your large objects, dump  
text only and fix with iconv, then reload the database and import the  
large objects.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Invalid UTF8  & Large Objects
  2006-04-25 20:17 Invalid UTF8  & Large Objects Prasanth <dbadmin@nqadmin.com>
  2006-04-26 04:55 ` Re: Invalid UTF8  & Large Objects John DeSoi <desoi@pgedit.com>
@ 2006-04-26 15:01   ` Prasanth <dbadmin@nqadmin.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Prasanth @ 2006-04-26 15:01 UTC (permalink / raw)
  To: John DeSoi <desoi@pgedit.com>; +Cc: pgsql-admin

I did the following and it worked.

1. Did a text pg_dump and used iconv to remove invalid characters and then
loaded this into the database.
2. Took a dump created using -Fc and restored just the pg_largeobject table.

Every thing seems to be good.

I don't see the -b option in pg_dump in 8.1.3 so am I right in saying that large
objects are automatically added to the dump?

Thanks,
-Prasanth.

John DeSoi wrote:
> 
> On Apr 25, 2006, at 4:17 PM, Prasanth wrote:
> 
>> But then my problem is I have to do a text dump to use iconv in which
>> case I will loose the large objects.
>> I tried using the iconv on the dump generated using the -Fc option and
>> then when I try to restore that  I am getting the following error
>> pg_restore: [archiver] entry ID 0 out of range -- perhaps a corrupt TOC
> 
> -Fc produces a binary format, so you can't use iconv on it. One option
> might be to write a script to export your large objects, dump text only
> and fix with iconv, then reload the database and import the large objects.
> 
> 
> 
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-04-26 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-25 20:17 Invalid UTF8  & Large Objects Prasanth <dbadmin@nqadmin.com>
2006-04-26 04:55 ` John DeSoi <desoi@pgedit.com>
2006-04-26 15:01   ` Prasanth <dbadmin@nqadmin.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox