Postgres COPY TO / FROM A FILE as non superuser

纵饮孤独 提交于 2019-12-10 00:10:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!