Re: writing a function without installing a language
| От | Craig Ringer |
|---|---|
| Тема | Re: writing a function without installing a language |
| Дата | |
| Msg-id | 482EA1E9.2070401@postnewspapers.com.au обсуждение |
| Ответ на | writing a function without installing a language ("${spencer}" <spence91@gmail.com>) |
| Ответы |
Re: writing a function without installing a language
|
| Список | pgsql-general |
${spencer} wrote:
> is there a way to write a function without installing a specific
> language? all i need to do is write a function that can take 3 text's
> and put them into a list format (eg. "text1, text2 and text3" )
Does PL/PgSQL count as a "language" for your purposes?
PL/PgSQL is built and shipped with the postgreSQL server. It's
essentially always installed. By default it's just not enabled for
access in any database.
The statement:
CREATE LANGUAGE plpgsql;
just tells a given database that PL/PgSQL should be available.
Failing that, you might be able to use an SQL function (though I don't
really see how you'd handle the special case for "and" without a
subquery to obtain a total result count) or write a C extension to do it.
Using PL/PgSQL is certainly the easy way.
--
Craig Ringer
В списке pgsql-general по дате отправления: