Re: COPY into a view; help w. design & patch

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <Robert(dot)Haas(at)dyntek(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY into a view; help w. design & patch
Date: 2007-05-21 17:02:29
Message-ID: 1179766949l.2547l.0l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2007-05-21 17:17:38 Re: COPY into a view; help w. design & patch
Previous Message Andrew Dunstan 2007-05-21 16:59:33 Re: UTF8MatchText