Re: [GENERAL] COPY: row is too big - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: [GENERAL] COPY: row is too big
Date
Msg-id 60e44495-bbea-742d-f157-19cdec0bb3ba@a-kretschmer.de
Whole thread Raw
In response to Re: [GENERAL] COPY: row is too big  (doganmeh <mehmet@edgle.com>)
List pgsql-general

Am 26.05.2017 um 14:07 schrieb doganmeh:
>
> I tried varchar(12) also, nothing changed. My questions is 1) I have
> 672x12=8,064 characters in the first row (which are actually the headers),
> why would it complain that it is 8760. I am assuming here type `text`
> occupies 1 byte for a character.

please consider special chars, a little example:

test=*# create table demo(id int, t text);
CREATE TABLE
test=*# insert into demo values (1, '123')
test-# ;
INSERT 0 1
test=*# insert into demo values (2, '€€€');
INSERT 0 1
test=*# select id, t, length(t), pg_column_size(t) from demo;
  id |  t  | length | pg_column_size
----+-----+--------+----------------
   1 | 123 |      3 |              4
   2 | €€€ |      3 |             10
(2 Zeilen)



--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com



pgsql-general by date:

Previous
From: "Charles Clavadetscher"
Date:
Subject: Re: [GENERAL] COPY: row is too big
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] COPY: row is too big