问题
im trying to create a function that any user can call in order to copy data from/to a file... my idea is to set a function that acts as a superuser or one that is executed as "postgres" but I dont know were to start to begin with.
Can anyone point me in the right direction?
回答1:
You're looking for "SECURITY DEFINER". See docs for details http://www.postgresql.org/docs/9.3/static/sql-createfunction.html
来源:https://stackoverflow.com/questions/20268420/postgres-copy-to-from-a-file-as-non-superuser