473,320 Members | 1,802 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,320 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 9708
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.