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