Search Postgresql Archives

Shared Constants in PLPGSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux