Defining global constants in Postgresql stored function/procedures?

constants, global, postgresql, stored-procedures

Solution

Take a look at this other answer. It uses the same approach that you do.

Create constant string for entire database

Problem

I have a set of functions I have created in PostgreSql. I would like to be able to configure some behavior and limits with global constants. So far, I have implemented functions like these, which my functions call to retrieve the constant value: ``` CREATE OR REPLACE FUNCTION slice_length() RETURNS integer AS $$ BEGIN RETURN 50; END; $$ LANGUAGE plpgsql IMMUTABLE; ``` I was wondering, is there a better/smarter way to achieve this?

Original source

Related problems