Search Postgresql Archives

COPY vs \COPY FROM PROGRAM $$ quoting difference?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found what seems to be an odd difference between COPY and \copy parsing.

I am using a bash pipeline of sed commands to clean up a source data file before importing it into a table.  This works fine when working from the command line and piping the result to psql on STDIN. 

However I attempted to put this same workflow into a psql script (as opposed to a shell script). To avoid quoting issues with the shell pipeline I put my pipeline command string in dollar quotes.

eg.
COPY dest_table FROM PROGRAM $$ sed 's/x/y/' | etc... $$ 

To my surprise this worked with COPY but not \COPY which failed with:
\copy: parse error at "$$"

Is this an undocumented difference? Is this even the appropriate email list to ask this kind of question or report such a difference?

Thank you,
Alex Stoddard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux