Re: arrays and polygons

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David" <de4(at)kent(dot)ac(dot)uk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: arrays and polygons
Date: 2004-02-13 15:02:39
Message-ID: 2252.1076684559@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"David" <de4(at)kent(dot)ac(dot)uk> writes:
> ALTER TABLE species ADD COLUMN location polygon[];

> INSERT INTO species (location) VALUES ('{((432,89), (45,87), (89,87)),
> ((54,78), (34,98))};

I think you'd need to double-quote each polygon within the array
literal.

'{"((432,89), (45,87), (89,87))", "..."}'

The array parser doesn't think parens are special, so it's not going to
magically distinguish array commas from polygon commas for you.

BTW, if you are using 7.4, the ARRAY[] constructor syntax might be
easier to use.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-02-13 15:02:51 Re: 7.4 - FK constraint performance
Previous Message Rod Taylor 2004-02-13 14:09:05 Re: column alias and group by/having/order