Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to prevent mangling when using COPY FROM PROGRAM

All this time we've been using Copy FROM PROGRAM without any additional adornments. Then we noticed for some things like directory listings in Microsoft windows, it would come across a sequence of inputs it mangled or you may even get an error such as ERROR: end-of-copy marker corrupt.

The trick to get around the issue is to use the FORMAT option. The default FORMAT for COPY FROM PROGRAM is 'text', which tries to escape out some things and in doing so it misinterprets windows slashes so you get weird stuff or no stuff at all.


Continue reading "How to prevent mangling when using COPY FROM PROGRAM"


This post first appeared on Postgres OnLine Journal, please read the originial post: here

Share the post

How to prevent mangling when using COPY FROM PROGRAM

×

Subscribe to Postgres Online Journal

Get updates delivered right to your inbox!

Thank you for your subscription

×