Running CREATE only on certain Postgres versions

Поиск
Список
Период
Сортировка
От Robert James
Тема Running CREATE only on certain Postgres versions
Дата
Msg-id CAGYyBgj+cFCDST4KSqM7o_FSpKA+B5Ynm-bxrKeJ7rX0+-aWUw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Running CREATE only on certain Postgres versions  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Re: Running CREATE only on certain Postgres versions  (Igor Neyman <ineyman@perceptron.com>)
Список pgsql-general
I have some code which creates a function in Postgres, taken from
http://wiki.postgresql.org/wiki/Array_agg .

DROP AGGREGATE IF EXISTS array_agg(anyelement);
CREATE AGGREGATE array_agg(anyelement) (
SFUNC=array_append,
STYPE=anyarray,
INITCOND='{}'
);

The function was added in 8.4, and so the code fails when run on 8.4 or higher.

How can I make the code cross-version compatible? For instance, how
can I tell it to check the version, and only run if 8.3 or lower?   Or
another way to make it cross-version?


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: 9.1 vs 8.4 performance
Следующее
От: "W. Matthew Wilson"
Дата:
Сообщение: How to do a full-text search words within some proximity of each other?