Re: New array functions

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: New array functions
Дата
Msg-id 871xv5liyl.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: New array functions  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:

> Greg Stark wrote:
> > So where are the new array functions and syntaces documented?
> 
> Mainly here:
> http://developer.postgresql.org/docs/postgres/arrays.html

excellent. thank you.

> > Specifically I want to know how to replace my int_array_aggregate(int) and
> > int_array_enum(_int) calls.
> 
> I have no idea what those are -- are they from contrib?

indeed in contrib/intagg

> You can create an aggregate to turn arbitrary datatype elements into arrays
> like this:
> 
> CREATE AGGREGATE array_aggregate
> (
>    BASETYPE = anyelement,
>    SFUNC = array_append,
>    STYPE = anyarray,
>    INITCOND = '{}'
> );

Hm, perhaps there should be a standard name for this, rather than have
everyone's code do their own thing.

> If int_array_enum() is supposed to take '{1,2,3}' and produce three rows, that
> function was proposed but rejected. Subsequently Peter Eisentraut pointed out a
> SQL99 syntax that does this, but I did not get it done for 7.4. Perhaps for 7.5.

That's exactly what it does. Hm, I guess I misinterpreted that post. Hm I have
some work to do.

Thanks. And thanks a LOT for doing the work, it'll makes a big difference
and make arrays much more practical to use.

-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bug with constraint dependencies? or bug with
Следующее
От: Tom Lane
Дата:
Сообщение: Re: bug with constraint dependencies? or bug with