Обсуждение: CONCAT function

Поиск
Список
Период
Сортировка

CONCAT function

От
Vinayak
Дата:
Hello,

The pg_catalog.concat() is defined as STABLE function.

As per my understanding a STABLE function cannot modify the database and is
guaranteed to return the same results given the same arguments for all rows
within a single statement.
Example:
current_timestamp family of functions qualify as stable, since their values
do not change within a transaction.

An IMMUTABLE function cannot modify the database and is guaranteed to return
the same results given the same arguments forever.

why was STABLE preferred for concat() over IMMUTABLE?




-----
Regards,
Vinayak,

--
View this message in context: http://postgresql.1045698.n5.nabble.com/CONCAT-function-tp5817884.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: CONCAT function

От
Tom Lane
Дата:
Vinayak <vinpokale@gmail.com> writes:
> The pg_catalog.concat() is defined as STABLE function.
> why was STABLE preferred for concat() over IMMUTABLE?

concat() invokes datatype output functions, which are not necessarily
immutable.  An easy example is that timestamptz_out's results depend
on the TimeZone setting.

            regards, tom lane


Re: CONCAT function

От
Vinayak
Дата:
Thank you for reply.
>concat() invokes datatype output functions, which are not necessarily
>immutable.  An easy example is that timestamptz_out's results depend
>on the TimeZone setting.

I understood.



-----
Regards,
Vinayak,

--
View this message in context: http://postgresql.1045698.n5.nabble.com/CONCAT-function-tp5817884p5818267.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.