Re: COPY: row is too big

From: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY: row is too big
Date: 2017-05-26 13:36:49
Message-ID: 60e44495-bbea-742d-f157-19cdec0bb3ba@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-05-26 14:21:02 Re: COPY: row is too big
Previous Message Charles Clavadetscher 2017-05-26 13:26:02 Re: COPY: row is too big