Re: Array intersection

Поиск
Список
Период
Сортировка
Искать
От
Josh Trutwin
Тема
Re: Array intersection
Дата
Msg-id
20071017142031.709c5ded@sinkhole.intrcomm.net
Ответ на
Re: Array intersection (David Fetter)
Список
Дерево обсуждения
Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection Sam Mason <sam@samason.me.uk>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection Sam Mason <sam@samason.me.uk>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection Sam Mason <sam@samason.me.uk>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection Sam Mason <sam@samason.me.uk>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection "Rodrigo De León" <rdeleonp@gmail.com>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection "Merlin Moncure" <mmoncure@gmail.com>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection David Fetter <david@fetter.org>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
Re: Array intersection David Fetter <david@fetter.org>
Re: Array intersection "Pavel Stehule" <pavel.stehule@gmail.com>
Re: Array intersection Josh Trutwin <josh@trutwins.homeip.net>
On Wed, 17 Oct 2007 11:26:05 -0700
David Fetter  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 по дате отправления
От: David Fetter
Дата:
Сообщение: Re: Array intersection
От: Richard Huxton
Дата:
FAQ