473,569 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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@dbserv er 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@dbserv er 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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #1
2 9718
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@dbserv er 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@dbserv er 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
4314
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 another directory that's outside of ClearCase. The strange thing is that the copy command actually copies correctly. The problem is that it returns a...
8
3299
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: BreakthroughClass(); virtual ~BreakthroughClass(); BreakthroughClass(const BreakthroughClass &source);
2
1633
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 the Copy Web Site feature of Copy Web to just copy the entire web site over, it thinks it has to re-upload the entire site which takes a very long...
1
5584
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 know if I'm using the command correctly. Question: I run this command as a superuser, and the "copy from" command is run like a SQL command on the...
4
7012
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 problem is. Version 7.41 is installed... see below for details: A comma delimited text file has been placed in a local directory with permissions...
4
17932
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. The script looks like this: -- create table -- ... -- define procedure and trigger
1
3527
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 with an identical schema, with existing data. I figured a good way to do this would be to use pg_dump on the small dataset, trim out the table...
3
2906
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 copytest I copy something to copytest2): <?php copy('05_17340.jpg', 'D:\\copytest2\\test.jpg'); ?>
3
1844
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 dos prompt , which is activated thru windows command prompt. pls let me know if there is some other way out.. regs devinath
9
15115
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 going to run BCP utility does not have SQL Server installed, so BCP.exe and its underlying DLLs are not there. I copied BCP.EXE, then it tells me that...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.