pg_dump problems - Mailing list pgsql-general

From Martín Marqués
Subject pg_dump problems
Date
Msg-id AANLkTinjOO5_6xupQ=UakBdUnU2NKcgJG8b_YzuoZejS@mail.gmail.com
Whole thread Raw
Responses Re: pg_dump problems  (Vick Khera <vivek@khera.org>)
List pgsql-general
Hi all,

I'm having problems with pg_dump, apparently, from one of our servers.

The scenario is like this. I tried today to dump a DB from our
production server to load on our development server and got some
errors, which I show below.

Production server:

SELECT version();
                                            version
-----------------------------------------------------------------------------------------------
 PostgreSQL 8.3.14 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real
(Debian 4.3.2-1.1) 4.3.2


Development server:

SELECT version();
                                               version
-----------------------------------------------------------------------------------------------------
 PostgreSQL 8.4.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real
(Debian 4.4.5-10) 4.4.5, 32-bit

Anyway, the problem is in the output of the pg_dump in the production server:

$ pg_dump -V
pg_dump (PostgreSQL) 8.3.14

The first error looks like related to encoding of bytea:

ERROR:  sintaxis de entrada no válida para tipo bytea
CONTEXTO:  COPY novedades_fotos, línea 23, columna foto:
«\377\330\377\340\000\020JFIF\000\001\002\001\000H\000H\000\000\377\355\020\006Photoshop
3.0\0008BIM\...»

But more strange is what comes later:

ERROR:  la sintaxis de entrada no es válida para integer: «954516ILa
educación superior en el sector aducativo del mercosur»
CONTEXTO:  COPY objeto_datos_rep, línea 1627732, columna codiobjeto:
«954516ILa educación superior en el sector aducativo del mercosur»

Checking that register in the production DB I get this:

SELECT * from objeto_datos_rep where codigo = 2357634;
 codigo  | codiobjeto |                        descripcion
           | tcampo
---------+------------+-----------------------------------------------------------+--------
 2357634 |     954516 | La educación superior en el sector aducativo
del mercosur |      5

So, why didn't pg_dump add the tabs between 954516 and "La educación..."?

Right now I'm trying to do dump with INSERTs instead of COPY command
to see what happens.

--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: General question
Next
From: Vick Khera
Date:
Subject: Re: pg_dump problems