Re: Allowing COPY into views

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allowing COPY into views
Date: 2007-04-19 15:07:39
Message-ID: 1176995259l.10180l.3l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 04/19/2007 09:39:18 AM, Alvaro Herrera wrote:

>
> I'm not sure the plan is OK as stated. You wouldn't want to force to
> parse the query again for each row. Rather, create a prepared
> statement
> (already parsed, because you obtain it from the parsetree stored in
> the
> INSERT rule) to pass to the executor.

I wasn't going to parse and plan an INSERT for each row
of data to COPY. Step 7 is the step that iterates over
the rows of COPY data. I make my own PREPAREd insert
and execute it in step 7 for each row of COPY data.

It seems to me it'd be eaiser to write my own INSERT statement
and call raw_parser on it than to try to modify the parsed
INSERT statement stored in the INSERT rule. (I didn't know
that was even there.) This is because the COPY statement
could only insert into some columns of the view.

It just seems easier to me to write an INSERT statement
and parse it than to take stuff out of an already
existing raw parse tree. Am I wrong?

Thanks for the help.

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 Karl O. Pinc 2007-04-19 15:09:12 Re: Allowing COPY into views
Previous Message Gregory Stark 2007-04-19 14:45:48 Re: Allowing COPY into views