Re: BUG #10052: COPY (...) TO 'file' doesn't create file - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: BUG #10052: COPY (...) TO 'file' doesn't create file
Date
Msg-id 20140416182851.GH7443@momjian.us
Whole thread Raw
In response to BUG #10052: COPY (...) TO 'file' doesn't create file  (postgresql.org@ch.pkts.ca)
List pgsql-bugs
On Wed, Apr 16, 2014 at 05:54:36PM +0000, postgresql.org@ch.pkts.ca wrote:
> The following bug has been logged on the website:
>
> Bug reference:      10052
> Logged by:          PFudd
> Email address:      postgresql.org@ch.pkts.ca
> PostgreSQL version: 9.2.8
> Operating system:   CentOS 6.5
> Description:
>
> In psql, this command works:
> #   copy (select * from history) to STDOUT;
> It prints 957 lines to stdout.
>
> However, if I do:
> #   copy (select * from history) to '/tmp/foo.txt';
> it prints
>    COPY 957
> but doesn't create the file /tmp/foo.txt.

Uh, you realize that is a file on the server, not on the client.  You
might want to try psql's \copy.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

pgsql-bugs by date:

Previous
From: greenreaper@hotmail.com
Date:
Subject: BUG #10051: Documentation should explain use of LOWER(X) text_pattern_ops indexes with LIKE to replace ILIKE
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #9046: vacuum analyze fails on a table that has domain that is a date rage