bug pg_dump - pg_restore

From: Hellmuth Vargas <hivs77(at)gmail(dot)com>
To: Lista Postgres ES <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: bug pg_dump - pg_restore
Date: 2019-10-04 19:21:47
Message-ID: CAN3Qy4pUdkaBVzUtNEgsAGLUpiP=qc3S8zkTch10jjqiKwiu4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola Lista
Estoy moviendo una informacion de un servidor a otro, ambos tiene instalado
la versión PostgreSQL 9.5.19, estoy exportando la informacion asi:

/opt/PostgreSQL/9.5/bin/pg_dump -U postgres -F c -f
/mnt/san/offline/phone.3oct2019.backup -j 3 -n phone -n phone_aud -v
callcenter

en la base origen tengo la siguiente tabla:

CREATE TABLE phone.cdr
(
calldate timestamp with time zone NOT NULL DEFAULT now(),
clid character varying(80) NOT NULL DEFAULT ''::character varying,
src character varying(80) NOT NULL DEFAULT ''::character varying,
dst character varying(80) NOT NULL DEFAULT ''::character varying,
dcontext character varying(80) NOT NULL DEFAULT ''::character varying,
channel character varying(80) NOT NULL DEFAULT ''::character varying,
dstchannel character varying(80) NOT NULL DEFAULT ''::character varying,
lastapp character varying(80) NOT NULL DEFAULT ''::character varying,
lastdata character varying(80) NOT NULL DEFAULT ''::character varying,
duration bigint NOT NULL DEFAULT (0)::bigint,
billsec bigint NOT NULL DEFAULT (0)::bigint,
disposition character varying(45) NOT NULL DEFAULT ''::character varying,
amaflags bigint NOT NULL DEFAULT (0)::bigint,
*accountcode character varying(20) NOT NULL DEFAULT ''::character varying*
,
uniqueid character varying(32) NOT NULL DEFAULT ''::character varying,
userfield character varying(255) NOT NULL DEFAULT ''::character varying,
temp_hora timestamp(0) without time zone DEFAULT now(),
id bigint NOT NULL DEFAULT nextval('phone.seq_cdr_ivr'::regclass),
CONSTRAINT cdr_ivr_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);

utilizo esta linea para importar el backup que generé, en el servidor
destino en el cual no existe el schema phone:

/opt/PostgreSQL/9.5/bin/pg_restore -U postgres -j 2 -d offline -v
/mnt/san/offline/phone.3oct2019.backup

al cabo de un rato genera el siguiente error:

2019-10-04 13:49:44 -05(at)[local]@38929: ERROR: *value too long for type
character varying(20)*
2019-10-04 13:49:44 -05@@[local](at)38929: CONTEXT: COPY cdr, line 4534809,
column accountcode: "isk/sounds/ivr-vali3.40696"
2019-10-04 13:49:44 -05(at)[local]@38929: STATEMENT: COPY cdr (calldate,
clid, src, dst, dcontext, channel, dstchannel, lastapp, lastdata, duration,
billsec, disposition, amaflags, accountcode, uniqueid, userfield,
temp_hora, id) FROM stdin;

2019-10-04 13:49:56 -05(at)[local]@38930: ERROR: canceling statement due to
user request

verifico en el servidor destino la definición de la tabla y es igual que
origen:

CREATE TABLE phone.cdr
(
calldate timestamp with time zone NOT NULL DEFAULT now(),
clid character varying(80) NOT NULL DEFAULT ''::character varying,
src character varying(80) NOT NULL DEFAULT ''::character varying,
dst character varying(80) NOT NULL DEFAULT ''::character varying,
dcontext character varying(80) NOT NULL DEFAULT ''::character varying,
channel character varying(80) NOT NULL DEFAULT ''::character varying,
dstchannel character varying(80) NOT NULL DEFAULT ''::character varying,
lastapp character varying(80) NOT NULL DEFAULT ''::character varying,
lastdata character varying(80) NOT NULL DEFAULT ''::character varying,
duration bigint NOT NULL DEFAULT (0)::bigint,
billsec bigint NOT NULL DEFAULT (0)::bigint,
disposition character varying(45) NOT NULL DEFAULT ''::character varying,
amaflags bigint NOT NULL DEFAULT (0)::bigint,
*accountcode character varying(20) NOT NULL DEFAULT ''::character
varying,*
uniqueid character varying(32) NOT NULL DEFAULT ''::character varying,
userfield character varying(255) NOT NULL DEFAULT ''::character varying,
temp_hora timestamp(0) without time zone DEFAULT now(),
id bigint NOT NULL DEFAULT nextval('phone.seq_cdr_ivr'::regclass)
)
WITH (
OIDS=FALSE
);

No entiendo, hago un dump y restore que cree el schema en el destino, se
supone que en el origen esta almacenado en un campo de tamaño igual!!! y el
mismo crea el schema en le destino!!

Les agradezco su colaboración

--
Cordialmente,

Ing. Hellmuth I. Vargas S.
Esp. Telemática y Negocios por Internet

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2019-10-04 19:36:46 Re: bug pg_dump - pg_restore
Previous Message kernel 2019-10-04 12:39:55 Re: Problemas de tamaño/recodificacion