pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem copying polygon data into a table
3+ messages / 3 participants
[nested] [flat]
* Problem copying polygon data into a table
@ 1999-12-13 06:36 Brent Wood <brent.wood@blazemail.com>
1999-12-13 07:29 ` Re: [SQL] Problem copying polygon data into a table Jan Wieck <wieck@debis.com>
1999-12-13 08:00 ` Re: [SQL] Problem copying polygon data into a table Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: Brent Wood @ 1999-12-13 06:36 UTC (permalink / raw)
To: pgsql-sql
I have an text file in the format:
800|((180.87575,-45.98757),(180.87868, -45.98798),...,(Xn,Yn))
to be read into a table of:
attr type
id int
region polygon
using the command
copy <table> from '<file>' using delimiters '|';
The polygon has about 800 vertices (& is relatively small as some of the
polygons in my dataset go).
Trying to copy this into the table generates the error msg:
ERROR: Tuple is too big: size 12892
Does this mean that I've done summat incorrect, or that there is an
undocumented limit in what can be loaded in a "copy" command, or a limit
in the size (not area) of a polygon attribute?
The message gives me the impression that there is a limit in the length
of the string representing the polygon, so I could possibly fit more
vertices by reducing the precision of each, but it still implies a limit
which may render PostgreSQL unsuitable for my purposes.
Any advice appreciated....
Thanks,
Brent
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] Problem copying polygon data into a table
1999-12-13 06:36 Problem copying polygon data into a table Brent Wood <brent.wood@blazemail.com>
@ 1999-12-13 07:29 ` Jan Wieck <wieck@debis.com>
1 sibling, 0 replies; 3+ messages in thread
From: wieck@debis.com @ 1999-12-13 07:29 UTC (permalink / raw)
To: brent.wood@blazemail.com; +Cc: pgsql-sql
> The polygon has about 800 vertices (& is relatively small as some of the
> polygons in my dataset go).
>
> Trying to copy this into the table generates the error msg:
>
> ERROR: Tuple is too big: size 12892
It is a very old limitation, that one row (including the
systems per row information and ALL attribute values) cannot
exceed 8K - pageheader.
800 vertices is 1600 double precision floats is 12800 bytes.
We actually discuss how to tackle that problem in a future
release. And that far we know about a solution that could
make your problem go away. What we don't have is a consensus
on, and implementation of this solution.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck@debis.com (Jan Wieck) #
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] Problem copying polygon data into a table
1999-12-13 06:36 Problem copying polygon data into a table Brent Wood <brent.wood@blazemail.com>
@ 1999-12-13 08:00 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 1999-12-13 08:00 UTC (permalink / raw)
To: Brent Wood <brent.wood@blazemail.com>; +Cc: pgsql-sql
Brent Wood <brent.wood@blazemail.com> writes:
> The polygon has about 800 vertices (& is relatively small as some of the
> polygons in my dataset go).
> Trying to copy this into the table generates the error msg:
> ERROR: Tuple is too big: size 12892
> Does this mean that I've done summat incorrect, or that there is an
> undocumented limit in what can be loaded in a "copy" command, or a limit
> in the size (not area) of a polygon attribute?
There is a limit, but it's hardly "undocumented" --- you're running into
the infamous 8K-per-tuple limit. I believe polygons are stored with
two float8's per vertex, so an 800-vertex polygon would take 16*800
bytes which matches your error message pretty nearly. You can only
expect to fit maybe 500 vertexes in the standard 8K block size ...
less if there's much other data in your tuples :-(
This is a longstanding problem. There is discussion raging right now
on the pghackers list about fixing it, and I think something may
actually happen in the next release or two. In the meantime, the
only reasonably simple recourse is to increase BLCKSZ (see
src/include/config.h). But you can only bump it up as far as 32K,
which'd be about 2K polygon vertexes; I don't know if that's enough
for your purposes.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-12-13 08:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-12-13 06:36 Problem copying polygon data into a table Brent Wood <brent.wood@blazemail.com>
1999-12-13 07:29 ` Jan Wieck <wieck@debis.com>
1999-12-13 08:00 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox