473,412 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

copy command problem

Hi,

I am recreating a database and its applications onto a new server and
new software; old version of pg was 7.2.4 and new version is

gds2=# select version();

version

--------------------------------------------------------------------------------------------------------
PostgreSQL 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
20030502 (Red Hat Linux 3.2.3-20)

I am having trouble with the copy command as follows:
gds2=# copy survey_match from '/home/djisgitt/perl/fixsvy.dat' with
delimiter as '>';
ERROR: could not open file "/home/djisgitt/perl/fixsvy.dat" for
reading: Permission denied

File sysem permissions are

[djisgitt@dbserver perl]$ ls -l /home/djisgitt/perl/fixsvy.dat
-rwxrwxrwx 1 djisgitt djisgitt 198441 Nov 5 12:35
/home/djisgitt/perl/fixsvy.dat

Table definition is

gds2=# \d survey_match
Table "public.survey_match"
Column | Type | Modifiers
--------+------+-----------
oldsvy | text |
oldblk | text |
newsvy | text |
newblk | text |
First few lines of file are:

[djisgitt@dbserver perl]$ head -5 fixsvy.dat
43 >H&TC >43
OS2 >

/ E CHAPMAN >KL >TCRR
/E CHAPMAN >KL >TCRR
133 >133 >133

and in hex...

0000000 > 4 3
2020 2020 2020 2020 2020 2020 343e 2033
0000020 > H & T C
2020 2020 3e20 2648 4354 2020 2020 2020
0000040 > 4 3 \n
2020 343e 0a33 2020 2020 2020 2020 2020
0000060 > O S 2 > \n / E
2020 4f3e 3253 2020 2020 3e20 2f0a 4520
0000100 C H A P M A N > K L
4320 4148 4d50 4e41 3e20 4c4b 2020 2020
0000120 > T C R R \n / E C H A P M
2020 543e 5243 0a52 452f 4320 4148 4d50
0000140 A N > K L > T C
4e41 2020 4b3e 204c 2020 2020 3e20 4354
0000160 R R \n 1 3 3 >
5252 310a 3333 2020 2020 2020 2020 3e20
0000200 1 3 3 > 1 3 3 \n

Only two defined users are both superusers

gds2=# select * from pg_shadow;
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd |
valuntil | useconfig
----------+----------+-------------+----------+-----------+--------+----------+-----------
postgres | 1 | t | t | t |
| |
djisgitt | 100 | t | t | t |
| |
(2 rows)
I tried a similar thing with a different table and input file with
identical results. What am I doing wrong? Yes, I read the copy
documentation for 7.4.

Thank you for your assistance.

Don

n.b. Implicitly stated but not declared: yes, this worked on 7.2.4 with
"with" replaced by "using" and "delimiter" replaced by "delimiters".
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
2 9711
Don Isgitt wrote:
Hi,

I am recreating a database and its applications onto a new server and
new software; old version of pg was 7.2.4 and new version is

gds2=# select version();

version

--------------------------------------------------------------------------------------------------------

PostgreSQL 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
20030502 (Red Hat Linux 3.2.3-20)

I am having trouble with the copy command as follows:
gds2=# copy survey_match from '/home/djisgitt/perl/fixsvy.dat' with
delimiter as '>';
ERROR: could not open file "/home/djisgitt/perl/fixsvy.dat" for
reading: Permission denied

File sysem permissions are

[djisgitt@dbserver perl]$ ls -l /home/djisgitt/perl/fixsvy.dat
-rwxrwxrwx 1 djisgitt djisgitt 198441 Nov 5 12:35
/home/djisgitt/perl/fixsvy.dat


Check, if your home and subdirectories has sufficient permissions: you
need at least r-x for others on the specific directories, otherwise your
backend is not able to access your dump.

chmod o+rx /home/djisgitt should do the job, i think

Bernd

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2


Bernd Helmle wrote:
Don Isgitt wrote:
Hi,

gds2=# copy survey_match from '/home/djisgitt/perl/fixsvy.dat' with
delimiter as '>';
ERROR: could not open file "/home/djisgitt/perl/fixsvy.dat" for
reading: Permission denied

File sysem permissions are

[djisgitt@dbserver perl]$ ls -l /home/djisgitt/perl/fixsvy.dat
-rwxrwxrwx 1 djisgitt djisgitt 198441 Nov 5 12:35
/home/djisgitt/perl/fixsvy.dat


Check, if your home and subdirectories has sufficient permissions: you
need at least r-x for others on the specific directories, otherwise
your backend is not able to access your dump.

chmod o+rx /home/djisgitt should do the job, i think

Bernd

Thank you, Bernd; that was the problem. I obviously didn't think about
the forest, since the tree was ok. :-[
Don
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tony George | last post by:
Hi, I'm having a problem using the Copy module on a ClearCase view that's been set as "readonly" (i.e. ct chview -readonly <view tag>). I want to copy a file out of this view and put it in...
8
by: RonHiler | last post by:
My copy constructor is crashing my program, and I can't figure out why. I'll try to make the code listing as short as I can. Here are the two headers: class BreakthroughClass { public:...
2
by: Steve Franks | last post by:
The Copy Web tool provided with VS.NET 2005 is very convenient. However every once in a while it seems to think the files on the remote server have changed, which they have not. Then when I use...
1
by: Knepper, Michelle | last post by:
Hi out there, I'm a first-time user of the "Copy ... From..." command, and I'm trying to load a table from a text flat file. http://www.postgresql.org/docs/7.4/static/sql-copy.html I don't...
4
by: Jon Asher | last post by:
Hi, I'm trying to do a simple import of a comma delimited text file with COPY but it's returning an error. The file has been granted all permissions in Linux, so it's not clear to me what the...
4
by: Kevin Murphy | last post by:
This is a tip for the record in case it helps somebody else in the future. I have an import script that relies on a stored procedure that runs as a trigger on inserts into a temporary table. ...
1
by: Rachel McConnell | last post by:
Hi, I am trying to import data using COPY, from a file containing thirty or so COPY commands each with 0 or more rows of data. Reason, I have a small data set I want to include into a database...
3
by: Marcel | last post by:
Hello, I have a problem with accessing files on other computers in my network. The network is a Windows 2000 workgroup network and I have administrator rights.... This works (from the directory...
3
by: devinath | last post by:
I came across a problem while running the system file. When the copy command is run using system command , it doesn’t copy files which have size of 0kb. But the same command works if run thru the...
9
by: fniles | last post by:
I would like to copy a table(s) from SQL Server 2005 to a CVS file and vice versa. I was thinking to use the BCP command line utility, but I have a few questions: 1. The machine where I am...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.