dbTalk Databases Forums  

[BUGS] BUG #1269: Copy To Gives Relative path error when explicit path given.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1269: Copy To Gives Relative path error when explicit path given. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1269: Copy To Gives Relative path error when explicit path given. - 09-25-2004 , 06:49 PM







The following bug has been logged online:

Bug reference: 1269
Logged by: William Mayhew

Email address: wmayhew3 (AT) hotmail (DOT) com

PostgreSQL version: 8.0 Beta

Operating system: WIN 2000 Professional

Description: Copy To Gives Relative path error when explicit path
given.

Details:

I just installed the 8.0 Beta version I downloaded last night and created a
test database today entitled 'testdb'. All file systems on my PC are NTFS.


I logged onto the 'testdb' database via the Windows command prompt, using
psql. Immediately, I got the following warning:

Warning: Console codepage (437) differs from windows codepage (1252)
8-bit characters will not work correctly. See PostgreSQL
documentation "Installation on Windows" for details.

Next, I created a table called 'users'.

Before I continue to describe the problem, please be aware that the exact
same problem resulted after leaving the codepage settings unchanged, and
after changing the codepage to 437 via the following command: cmd.exe /c
chcp 437.
I chose 437 because it seemed logical to try that in the event the default
codepage had some undesirable effect on the outcome of my problem. OK, back
to the problem.

After creating a few rows in the users table. Of course, I ran a count(*)
query and the number of rows matched the number I inserted into the table.
Just to make sure, I queried all rows to verify the exact data. Next, I
tried to export the data into a flat file. Here is my syntax and the
accompanying error:

testdb=# COPY users TO 'D:\Program
Files\PostgreSQL\DataFlatFiles\usersdata';
ERROR: relative path not allowed for COPY to file

That looks like an explicit filename to me, so how can the server view the
quoted filename as a relative path?
What exactly is the server looking for?

Out of desperation I tried to use double quotes, but that seemed to generate
a syntax error.

Next, I thought I would try to change the current working directory to the
exact location where I wanted to write the output file, "usersdata." On
this attempt, I did not refer to the drive letter or the path. Here are the
results of my plsql commands:

Step 1
testdb-# \! dir
Volume in drive D has no label.
Volume Serial Number is 78D0-B9A2

Directory of D:\Program Files\PostgreSQL\DataFlatFiles

09/25/2004 07:36p <DIR> .
09/25/2004 07:36p <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 6,354,862,080 bytes free

Step 2
testdb=# COPY users TO 'usersdata.txt';
ERROR: relative path not allowed for COPY to file

Am I doing something wrong or is this an actual bug?





---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1269: Copy To Gives Relative path error when explicit path given. - 09-25-2004 , 07:37 PM






"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> writes:
Quote:
testdb=# COPY users TO 'D:\Program Files\PostgreSQL\DataFlatFiles\usersdata';
ERROR: relative path not allowed for COPY to file
You need to double the backslashes. Or use forward slashes.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.