array operators

Поиск
Список
Период
Сортировка
От David Orme
Тема array operators
Дата
Msg-id 13D73783-0D92-4C19-A74A-8498F221F6B1@ic.ac.uk
обсуждение исходный текст
Ответы Re: array operators  (David Orme <d.orme@imperial.ac.uk>)
Список pgsql-novice
Hi,

Can someone explain where I've gone wrong?

Given the table array_check:

> postgis_test=# select * from array_check;
> node |  sons
> ------+--------
>     1 |
>     2 |
>     4 |
>     3 |
>    -3 | {1,2}
>    -2 | {-3,3}
>    -1 | {-2,4}
> (7 rows)

and that this query returns an array value...
>
> postgis_test=# select sons from array_check where node = -3;
> sons
> -------
> {1,2}
> (1 row)

and that this works...

> postgis_test=# select node = any('{1,2}') as son_rows from
> array_check ;
> son_rows
> -----------
> t
> t
> f
> f
> f
> f
> f
> (7 rows)

.. why does this not throw an error?

> postgis_test=# select node = any(select sons from array_check where
> node = -3) as son_rows from array_check ;
> ERROR:  operator does not exist: integer = integer[]

Cheers,
David

> postgis_test=# select version();
>
>   version
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> -----------
> PostgreSQL 8.0.4 on powerpc-apple-darwin8.2.0, compiled by GCC
> powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple
> Computer, Inc. build 4061)
> (1 row)



В списке pgsql-novice по дате отправления:

Предыдущее
От: kadil
Дата:
Сообщение: Re: vacuuming and manu updates
Следующее
От: Ted Rolle
Дата:
Сообщение: Route to backend