Re: Error 42704 - does mean what? - Mailing list pgsql-general

From Craig Ringer
Subject Re: Error 42704 - does mean what?
Date
Msg-id 507BC0BD.8070906@ringerc.id.au
Whole thread Raw
In response to Error 42704 - does mean what?  (Kim Bisgaard <kim+pg@alleroedderne.adsl.dk>)
List pgsql-general
On 10/15/2012 03:37 PM, Kim Bisgaard wrote:
> [Cross post from -SQL]
>
> Hi,
>
> I am trying to model a macro system where I have simple things, and more
> complex thing consisting of simple things. To do that I have "invented"
> this table definition:

Didn't I recently see something like this on Stack Overflow? I can't
seem to find the question in searches but I remember that description.

> ERROR: could not find array type for data type text[]
> SQL state: 42704

According to:

http://www.postgresql.org/docs/current/static/errcodes-appendix.html

42704 is "undefined_object".


What it really means is that a multi-dimensional array is not just an
array of arrays.

regress=# SELECT pg_typeof(ARRAY[['a','b'],['c','d']]);
  pg_typeof
-----------
  text[]
(1 row)

regress=# WITH arr(x) AS (VALUES (ARRAY['a','b']), (ARRAY['c','d']))
SELECT array_agg(x) FROM arr;
ERROR:  could not find array type for data type text[]



--
Craig Ringer


pgsql-general by date:

Previous
From: Kim Bisgaard
Date:
Subject: Error 42704 - does mean what?
Next
From: Jasen Betts
Date:
Subject: Re: moving from MySQL to pgsql