Re: CREATE TYPE with array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Wolfgang Drotschmann <drotschm(at)fgan(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CREATE TYPE with array
Date: 2003-07-23 14:52:33
Message-ID: 13054.1058971953@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Wolfgang Drotschmann <drotschm(at)fgan(dot)de> writes:
> create table xs ( a char(5), l int4array[]);
> CREATE TABLE
> insert into xs values('abcde', '{1,2,3,4}');
> ERROR: array_in: Need to specify dimension

int4array is already an array; I don't think you want to make an array
of arrays. It might work if you wrote the value as something like

'{''{1,2,3}'',''{4,5,6}''}'

(not sure that I have the quoting quite right here) but that sure seems
like the hard way compared to using a multidimensional array.

In short, declare l as int4array not int4array[].

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-07-23 15:35:11 Re: Struggling with set-returning functions, seeking advice
Previous Message Joepie Platteau 2003-07-23 13:19:45 PSQL locks records in the table...