is there a reason we can't copy from a view?
... other than it just got forgotten?
dolszewski=# create view meh as select * from pg_tables;
CREATE VIEW
dolszewski=# copy meh to stdout;
ERROR: cannot copy from view "meh"
HINT: Try the COPY (SELECT ...) TO variant.
dolszewski=# copy (select * from meh) to stdout;
pg_catalogpg_statisticpostgres\Ntff
pg_catalogpg_typepostgres\Ntff
--
-- Josh Berkus
PostgreSQL Experts Inc.
http://www.pgexperts.com
Josh Berkus <josh@agliodbs.com> writes:
... other than it just got forgotten?
We've been over that ground before. IIRC the conclusion was that
letting COPY TO pretend that a view is a table is a bad idea because
then people would complain about COPY FROM not working for it. You
can use
COPY (select * from myview) TO ...
so the functionality is available.
regards, tom lane