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

COPY and views

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: COPY and views
Date: 2002-05-26 06:32:01
Message-ID: 20020526023201.278e997d.nconway@klamath.dyndns.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Is there a reason for the following behavior?

nconway=# create table a (col1 int);
CREATE TABLE
nconway=# insert into a default values;
INSERT 1883513 1
nconway=# copy a to '/tmp/output';
COPY
nconway=# create view myview as select * from a;
CREATE VIEW
nconway=# copy myview to '/tmp/output';
ERROR:  You cannot copy view myview

I can understand not allowing COPY FROM to target a view
(or at least, a view without an insertion rule defined) --
but is there a similar reason for disallowing copying data
out of a view?

Cheers,

Neil

-- 
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

Responses

pgsql-hackers by date

Next:From: Teodor SigaevDate: 2002-05-26 11:17:58
Subject: Re: strange update problem with 7.2.1
Previous:From: Ian BarwickDate: 2002-05-26 06:28:12
Subject: Q: unexpected result from SRF in SQL

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