Frustration with \copy

From: Ralph Smith <rsmith(at)10kinfo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Frustration with \copy
Date: 2010-09-10 17:25:52
Message-ID: 4C8A6A20.3000907@10kinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As someone famous once said:

The documentation I've found on \copy says to see the docs on copy ;)

It's *supposed* to match the backend syntax, but seems a few bricks
shy of a load at the moment. Anyone feel like fixing it? See
parse_slash_copy() in src/bin/psql/copy.c.

That was a while ago, but it seems to still hold true.
I'm assuming it HAD to work (ca v7.4), if one just had the syntax laid out right.

I have a one column .txt file on Ubuntu that I'm trying to upload, and ....
\copy new_coupons '/home/rsmith/testfile.txt'
\copy: parse error at "'/home/rsmith/testfile"

I've looked for caveats (that I didn't expect to find) WRT the EOL delimiter.
I also apostrophed the text when it didn't need it.

In my very recent unemployed state I boned-up-on and did a little consulting on
Oracle and MySQL, and the others did work.
Now I remember why I had dark clouds associated with this command.

If I have to I can build a series of INSERT statements.

Yes, we are planning to upgrade to 8.3, but now I'm stuck w/ 7.4.
Should I just INSERT?

Thanks!
Ralph

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma 2010-09-10 17:25:55 Re: regexp on null
Previous Message Gauthier, Dave 2010-09-10 16:56:32 Re: regexp on null