Re: Allowing COPY into views - Mailing list pgsql-hackers

From Karl O. Pinc
Subject Re: Allowing COPY into views
Date
Msg-id 1176995259l.10180l.3l@mofo
Whole thread Raw
In response to Re: Allowing COPY into views  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Allowing COPY into views  (Alvaro Herrera <alvherre@commandprompt.com>)
List 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@meme.com>
Free Software:  "You don't pay back, you pay forward."                 -- Robert A. Heinlein



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Allowing COPY into views
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Allowing COPY into views