Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA30498 for ; Sun, 13 Jun 1999 16:10:22 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id QAA00464; Sun, 13 Jun 1999 16:09:42 -0400 (EDT) To: Chris Bitmead cc: pgsql-hackers@hub.org Subject: Re: [HACKERS] COPY bug? In-reply-to: Your message of Sun, 13 Jun 1999 22:21:59 +1000 <3763A267.1049DB7A@bigfoot.com> Date: Sun, 13 Jun 1999 16:09:42 -0400 Message-ID: <462.929304582@sss.pgh.pa.us> From: Tom Lane Chris Bitmead writes: > Just wondering, when I do a COPY in the latest CVS into a file, it makes > the file both where I ask it to AND in > /home/postgres/data/base/. I've tried removing both files and > doing it again, and it still happens. The one in /home/postgres looks > like some kind of binary file. Can't reproduce it here. Anyone else seeing this? If you do something like COPY int4_tbl TO 'int4out'; you will get the file dumped into the database directory, because that is the current working directory of the backend; you need to give a full path in this form of the COPY command to get the file put someplace more useful. But I don't see how COPY could produce two output files when it's only doing one fopen()... It occurs to me that it's a very dangerous thing for server-side COPY to default to storing into the DB directory; pick the name of an existing table and boom, you just overwrote your table. Maybe the server-side COPY command ought to insist on being given an absolute path? regards, tom lane