Re: Invalid field size

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Moreno Andreo <moreno(dot)andreo(at)evolu-s(dot)it>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Invalid field size
Date: 2017-07-04 14:36:45
Message-ID: a2bd2f24-280e-ecaf-6b46-eba7db8baac6@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/04/2017 04:16 AM, Moreno Andreo wrote:
> I've implemented a backup procedure in C# with Npgsql (using COPY TO I
> dump all tables in a compressed file) that's been working well in the
> last 5 years (and it's still working, since this is a single, isolated
> case).
>
> OS: Windows 7
> PG: 9.1.6 (I know, it's EOL, but I think it's not matter here)

Are you restoring to same as above or to another machine or Postgres
instance?

>
> While restoring (with COPY FROM) I get this error:
> 2017-07-04 12:55:27 CEST ERROR: invalid field size
> 2017-07-04 12:55:27 CEST CONTEXT: COPY tab, line 619, column thumbnail
> 2017-07-04 12:55:27 CEST STATEMENT: COPY
> tab(cod,guid,data,blob,thumbnail,descr,type,url,user,home,codrec,table,op,dagg,last)
> FROM STDIN WITH BINARY
>
> with this table definition:
>
> CREATE TABLE public.tab
> (
> cod uuid NOT NULL DEFAULT uuid_generate_v4(),
> guid uuid NOT NULL,
> data timestamp without time zone NOT NULL,
> blob bytea,
> thumbnail bytea,
> descr character varying(255) DEFAULT NULL::character varying,
> type character varying(50) DEFAULT NULL::character varying,
> url character varying(255) DEFAULT NULL::character varying,
> user character varying(255) DEFAULT NULL::character varying,
> home character varying(255) DEFAULT NULL::character varying,
> codrec uuid,
> table character varying(30) DEFAULT NULL::character varying,
> op character(1) DEFAULT NULL::bpchar,
> dagg timestamp without time zone,
> last character varying(16) DEFAULT NULL::character varying
> )
>
> As you can see I have 2 bytea fields, blob and thumbnail (the one it
> seems it's giving the error), but AFAIK the former is never used, so it
> should be always null.
> Googling around did not help.
>
> Any ideas? As for many error I got in the past I assume we are trying to
> COPY FROM corrupted data (when using cheap pendrives we get often this
> error). Should it be reasonable or I have to search elsewhere?
>
> Thanks in advance
> Moreno.
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Moreno Andreo 2017-07-04 14:44:14 Re: Invalid field size
Previous Message Glyn Astill 2017-07-04 14:30:12 Re: Invalid field size