Re: BUG #1456: COPY FROM error

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Pascal Van Puymbroeck" <pascal(dot)vanpuymbroeck(at)zenonproductions(dot)be>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #1456: COPY FROM error
Date: 2005-02-03 14:02:57
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE47679A@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> The following bug has been logged online:
>
> Bug reference: 1456
> Logged by: Pascal Van Puymbroeck
> Email address: pascal(dot)vanpuymbroeck(at)zenonproductions(dot)be
> PostgreSQL version: 8.0.1
> Operating system: Windows 2000
> Description: COPY FROM error
> Details:
>
> The COPY table FROM command works fine as long as you use
> drives local to the machine like c: or e: , but when you try
> to use the command with a network drive mapped to o: for
> eaxmple, you get a 'could not open file for
> reading: invalid argument' error.

This is to be expected - the server runs with it's own user account, and
as such it won't have access to your profile with it's mapped drives.
Your solutions are:

*) Use an UNC mapped path (\\server\share\dir\file). This will require
either postgresql running as a domain account, or anonymous SMB (which
you *really* should have turned off)

*) use psql's \copy command. This one will write the file from the
client, and using your own windows account, so it shuold work fine with
mapped drives. This is what I'd recommend if you're doing one-off loads,
but it might be a bit trickier if you want it integrated in an app.

//Magnus

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2005-02-03 14:04:20 Re: Postgres install on windows 2003 server
Previous Message Theodore Petrosky 2005-02-03 12:43:31 Re: BUG #1458: to_char is crazy