[GENERAL] Shared Constants in PLPGSQL

Поиск
Список
Период
Сортировка
От Tim Uckun
Тема [GENERAL] Shared Constants in PLPGSQL
Дата
Msg-id CAGuHJrNipwCVQx5RYLjdF5CEk_cgeSMimZ_aGwk_5B2_wEOusg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Shared Constants in PLPGSQL
Re: [GENERAL] Shared Constants in PLPGSQL
Список pgsql-general
What's the best way to deal with global constants in PLPGSQL. Currently I am putting them in a function with out parameters and then calling that function from every other function that needs them like this.

CREATE OR REPLACE FUNCTION hashids.constants(
     OUT min_alphabet_length integer, 
    OUT sep_div numeric, 
    OUT guard_div numeric, 
    OUT default_steps text, 
    OUT default_alphabet text, 
    OUT salt text)

I am presuming that if I set this function as immutable the calls to this function will be cached and will not incur much overhead.

Is there a better way to deal with this?

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

Предыдущее
От: Murtuza Zabuawala
Дата:
Сообщение: [GENERAL] Not able to create collation on Windows
Следующее
От: "btober@computer.org"
Дата:
Сообщение: Re: [GENERAL] Shared Constants in PLPGSQL