Is it possible to define global variables in postgresql
问题 I am using postgresql 9.4 and while writing functions I want to use self-defined error_codes (int). However I may want to change the exact numeric values later . For instance -1 means USER_NOT_FOUND. -2 means USER_DOES_NOT_HAVE_PERMISSION. I can define these in a table codes_table(code_name::text, code_value::integer) and use them in functions as follows (SELECT codes_table.code_value FROM codes_table WHERE codes_table.code_name = 'USER_NOT_FOUND') Is there another way for this. Maybe global