title: SECURITY DEFINER - privileges of the function's creator, or owner?
body: <p>Postgres's <a href="https://www.postgresql.org/docs/9.4/static/sql-createfunction.html" rel="noreferrer">official docs</a> indicate that functions defined with SECURITY DEFINER run with privileges of the user who <strong>created</strong> it.</p>
  
  <p>However other sources, such as <a href="https://stackoverflow.com/questions/15867175/postgresql-db-user-should-only-be-allowed-to-call-functions">here</a> and <a href="https://dba.stackexchange.com/questions/46833/what-are-the-privileges-required-to-execute-a-trigger-function-in-postgresql-8-4">here</a>, claim it is the privileges of the <strong>owner</strong> of the function.</p>
  
  <p>Which is correct?</p>
  
  <p>(for 9.4+)</p>