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

Re: Possible TODO item: copy to/from pipe

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Possible TODO item: copy to/from pipe
Date: 2006-05-31 15:37:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> After re-reading what I just wrote to Andreas about how compression of
> COPY data would be better done outside the backend than inside, it
> struck me that we are missing a feature that's fairly common in Unix
> programs.  Perhaps COPY ought to have the ability to pipe its output
> to a shell command, or read input from a shell command.  Maybe something
> like
> 	COPY mytable TO '| gzip >/home/tgl/mytable.dump.gz';

> (I'm not wedded to the above syntax, it's just an off-the-cuff thought.)
> Of course psql would need the same capability, since the server-side
> copy would still be restricted to superusers.

Won't help too much, until gzip's output is piped back too, so a 
replacement for COPY .. TO STDOUT COMPRESSED  would be
COPY ... TO '| /bin/gzip |' STDOUT, to enable clients to receive the 
reduced stuff. But clients should be agnostic of server side installed 
tools, and probably not be able to address them directly. Sounds like a 
potential security issue.


In response to


pgsql-hackers by date

Next:From: Andreas PflugDate: 2006-05-31 15:41:04
Subject: Re: Possible TODO item: copy to/from pipe
Previous:From: Andreas PflugDate: 2006-05-31 15:31:13
Subject: Re: copy with compression progress n

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