Re: COPY into a view; help w. design & patch - Mailing list pgsql-hackers

From Karl O. Pinc
Subject Re: COPY into a view; help w. design & patch
Date
Msg-id 1179766949l.2547l.0l@mofo
Whole thread Raw
In response to Re: COPY into a view; help w. design & patch  ("Jim C. Nasby" <decibel@decibel.org>)
Responses Re: COPY into a view; help w. design & patch  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
On 05/21/2007 11:23:57 AM, Jim C. Nasby wrote:

> What about adding COPY support to rules? ISTM if you want to copy into
> a
> view you probably want to insert into it as well, so why not use the
> same mechanism? Presumably a COPY rule would also be faster than a
> trigger.

I'd say there's no difference between the rule you'd use
for COPYing and the rule you'd use for INSERTing,
which is why my patch produces an
INSERT statement and then proceeds to (attempt
to) execute the statement for every row of data
to be copied.  If you don't have a rule that allows
INSERT into the view you get (the already existing)
error with a hint that tells you to make an INSERT
rule.

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."                 -- Robert A. Heinlein



pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: COPY into a view; help w. design & patch
Next
From: "Jim C. Nasby"
Date:
Subject: Re: COPY into a view; help w. design & patch