| От | Josh Trutwin |
|---|---|
| Тема | Re: Array intersection |
| Дата | |
| Msg-id | 20071017142031.709c5ded@sinkhole.intrcomm.net обсуждение исходный текст |
| Ответ на | Re: Array intersection (David Fetter <david@fetter.org>) |
| Список | pgsql-general |
On Wed, 17 Oct 2007 11:26:05 -0700
David Fetter <david@fetter.org> wrote:
> > Doesn't appear to work on 8.1:
> >
> > psql=> select array_intersect('{1,2,3}', '{2,3,4}');
> > ERROR: could not determine anyarray/anyelement type because input
> > has type "unknown"
>
> As mentioned in the "release notes" ;), it's up to you to ensure
> that the arrays have the right types, so you'd write the above as:
>
> SELECT array_intersect('{1,2,3}'::int[], '{2,3,4}'::int[]);
Ah - I saw that but I figured that just meant you couldn't do
something like this:
SELECT array_intersect('{1,2,3}', '{"a","b","c"}');
So basically with this array intersect function you always need to
cast the inputs.
Josh
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера