Re: Arrays and COPY FROM: Help!!!

From: "Eric G(dot) Miller" <egm2(at)jps(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Arrays and COPY FROM: Help!!!
Date: 2001-04-08 06:58:24
Message-ID: 20010407235824.B13742@calico.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 05, 2001 at 04:31:57PM +0200, Laurent MARTIN wrote:
> Hi!
>
> I'm now using PostgreSQL for a few months now and I need to use arrays
> in some tables of my database. I've read some documentation about using
> arrays with PostgreSQL, but I still don't how I can perform a 'COPY
> FROM' to insert large number of records : of course inserted records
> should contain multidimensionnal fields... Who does know the way to do
> it ???
>
> Thank you for advance.

CREATE TABLE twodim (array integer[2][2]);
COPY twodim FROM stdin USING DELIMITERS '|';
{{1,2},{3,4}}
{{4,3},{2,1}}
\.

The level of nesting of braces "{}" indicates the dimensions of the
array. 1-dim {} , 2-dim {{},{}}, etc.

--
Eric G. Miller <egm2(at)jps(dot)net>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric G. Miller 2001-04-08 07:05:13 Re: Question about SELECT FOR UPDATE in transaction, isolation level
Previous Message Eric G. Miller 2001-04-08 06:16:35 Re: Can timeout duration be set?