How to use \COPY command inside a function in PostgreSQL
I want to export the table into a .CSV file using 开发者_如何学Go\COPY command. I can able to do that as a stand-alone command. I can't embed the same line inside a function in PostgreSQL. Actually that call should come from a ECPG. I chose \COPY over COPY command as I don't have super-user account! Please guide me on this.
Thanks and Regards, Siva.
Unfortunately, all of the \
commands are psql
commands. You can run psql -E
to see what those commands expand into and get sent to the server as, but if you need a super-user account to run COPY
, you're going to need a super-user account to do this.
If you are talking about using copy with plpgsql, I think this might help:
Dynamically-generated table-name in PostgreSQL COPY command
精彩评论