Re: [HACKERS] COPY bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] COPY bug?
Date: 1999-06-13 20:09:42
Message-ID: 462.929304582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-ports pgsql-sql

Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com> 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/<filename>. 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-06-13 20:26:42 Re: [HACKERS] new patch
Previous Message Massimo Dal Zotto 1999-06-13 20:01:16 new patch

Browse pgsql-ports by date

  From Date Subject
Next Message Henry B. Hotz 1999-06-14 00:39:23 Re: [HACKERS] Re: [PORTS] Patch for m68k architecture
Previous Message Herouth Maoz 1999-06-13 10:57:27 Status of LinuxPPC?

Browse pgsql-sql by date

  From Date Subject
Next Message Brett W. McCoy 1999-06-13 20:15:37 DISTINCT not working
Previous Message Brett W. McCoy 1999-06-13 17:37:50 Re: [SQL] DISTINCT not working