Skip site navigation (1) Skip section navigation (2)

COPY (query) TO file

From: "Mark Woodward" <pgsql(at)mohawksoft(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: COPY (query) TO file
Date: 2006-06-02 13:39:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom had posted a question about file compression with copy. I thought
about it, and I want to through this out and see if anyone things it is a
good idea.

Currently, the COPY command only copies a table, what if it could operate
with a query, as:

COPY (select * from mytable where foo='bar') as BAR TO stdout

I have no idea if it is doable, but I can see uses for replication

psql -h source mydb -c "COPY (select * from mytable where ID > xxxxx) as
mytable TO STDOUT" | psql -h target mydb -c "COPY mytable FROM stdin"


pgsql-hackers by date

Next:From: Larry RosenmanDate: 2006-06-02 13:40:49
Subject: Re: Going for 'all green' buildfarm results
Previous:From: Tom LaneDate: 2006-06-02 13:36:27
Subject: Re: Going for 'all green' buildfarm results

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group