Re: [PATCHES] COPY view

From: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] COPY view
Date: 2006-08-23 17:28:37
Message-ID: 44EC9045.5040704@dunaweb.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane írta:
> [ cc list trimmed to something reasonable ]
>
> Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu> writes:
>
>> OK, here's my current version. The reference leak is fixed.
>> But as my testcase shows, it only works for single selects
>> currently. The parser accepts it but COPY doesn't produce
>> the expected output. Please, suggest a solution.
>>
>
> This patch seems to be adding a tremendous amount of duplicated code
> in copy.c. Why?
>

1. to minimize the already huge code impact on the relation case.
2. the checks done for the SELECT case is not exactly the
same as for the realation case.
3. the relation case is managed by passing around
a Relation pointer, e.g. CopyGetAttnums. This simply
not appropriate for the SELECT case.

I will try to clean it up as much as I can, though.
How about the callback solution for the SELECT case
that was copied from the original? Should I consider
open-coding in copy.c what ExecutorRun() does
to avoid the callback?

> Also, moving checks for the relation case out of copy.c and into
> analyze.c is inappropriate. The checks you have moved there are
> actually wrong because you have no lock on the relation at the time
> you are checking. You could perhaps take a lock at analyze time,
> but frankly I see no reason for this patch to be messing with the
> relation case at all.
>

OK, I will put the checks back where they were.

> As for the UNION problem, try passing the query to transformStmt
> rather than prejudging where transformStmt will send it. Compare for
> instance the analyze.c code for ExplainStmt.
>

Thanks.

Best regards,
Zoltán Böszörményi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2006-08-23 17:33:51 Re: Win32 max connections bug (causing crashes)
Previous Message Andrew Dunstan 2006-08-23 17:11:47 Re: [PATCHES] COPY view

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-23 17:35:29 Re: [PATCHES] COPY view
Previous Message Andrew Dunstan 2006-08-23 17:11:47 Re: [PATCHES] COPY view