Thank you very much for your help. I change my query to
copy tmp_reb_user_group from 'tmp.txt' using delimiter '|'
However, when I try to test with psql shell, I can not use the copy command since It display error message
You must have Postgres superuser privilege to do a COPY directly to or from a file. Anyone can COPY to stdout or from stdin. Psql's \copy command also works for anyone.
that why I try to use \copy in TCL.
Note the following command work fine with psql shell
--
\copy tmp_reb_user_group from tmp.txt using delimiters "|"
--
Some one suggest me to use "exec "
to exec the psql command. I have try but it doesn't work
like
psql \copy tmp_reb_user_group from tmp.txt using delimiters "|"
I think it is the problem that I pass the command incorrectly to psql shell . Could you please point out my mistake?
Thank you very much