From: | Dan Colish <dan(at)unencrypted(dot)org> |
---|---|
To: | PGSQL-HACKERS <pgsql-hackers(at)postgresql(dot)org> |
Subject: | ECPG patch views [moved from RRR list] |
Date: | 2009-09-28 16:43:49 |
Message-ID: | 20090928164349.GA5175@funkstrom.pdx.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
----- Forwarded message from Robert Haas <robertmhaas(at)gmail(dot)com> -----
Date: Sun, 27 Sep 2009 12:52:35 -0400
From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Dan Colish <dan(at)unencrypted(dot)org>, pgsql-rrreviewers(at)postgresql(dot)org,
Jeff Janes <jeff(dot)janes(at)gmail(dot)com>,
Hans-Juergen Schoenig <hs(at)cybertec(dot)at>,
Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: CF 2009-09: initial reviewing assignments
2009/9/27 Boszormenyi Zoltan <zb(at)cybertec(dot)at>:
>>
>> On Sat, Sep 26, 2009 at 11:39:45AM -0700, Jeff Janes wrote:
>> > Hi Robert,
>> >
>> > Is there another patch you'd like me to work on?
>> >
>> > Lock wait statistics says it needs review, but the last comment
>> > suggests it is waiting on author.
>> >
>> > Enhancements to COPY (error logging and autopartitioning) says it is
>> > waiting on author but last comment suggests perhaps it is ready for
>> > review.
>> >
>> > I've taken a look at ECPG, but I couldn't make heads or tails of it.
>> > I guess I could try harder :)
>> >
>> > It looks like the ECPG patches are not independent and need to applied
>> > in a particular order in order for them to apply cleanly to HEAD.
>> >
>> > So I think I need some guidance on what I should be doing.
>> >
>> > Thanks,
>> >
>> > Jeff
>> >
>>
>> I've been looking at the dynamic cursor names patch, so if you have any
>> insights I would really appreciate them. I am having some trouble fully
>> reviewing this patch because I am not very familiar with the ecpg code.
>>
>> --
>> --Dan
>>
>
> Asketh and you shall be given. :-)
>
> May I help you in understanding ECPG?
>
> The dynamic cursorname patch was started on 8.3.7 first
> and we moved to 8.4 (then 8.5) CVS because in 8.4,
> ECPG grammar was rewritten to be auto-generated
> from the core grammar. I had to dive in kneep deep
> before I could modify it...
>
> Basic thing is that ECPG modifies and extends the core
> grammar in a way that
> 1) every token in ECPG is <str> type. New tokens are
> defined in ecpg.tokens, types are defined in ecpg.type
> 2) most tokens from the core grammar are simply converted
> to literals concatenated together to form the SQL string
> passed to the server, this is done by parse.pl.
> 3) some rules need side-effects, actions are either added
> or completely overridden (compared to the basic token
> concatenation) for them, these are defined in ecpg.addons,
> the rules for ecpg.addons are explained below.
> 4) new grammar rules are needed for ECPG metacommands.
> These are in ecpg.trailer.
> 5) ecpg.header contains common functions, etc. used by
> actions for grammar rules.
>
> In "ecpg.addons", every modified rule follows this pattern:
> ECPG: dumpedtokens postfix
> where "dumpedtokens" is simply tokens from core gram.y's
> rules concatenated together. e.g. if gram.y has this:
> ruleA: tokenA tokenB tokenC {...}
> then "dumpedtokens" is "ruleAtokenAtokenBtokenC".
> "postfix" above can be:
> a) "block" - the automatic rule created by parse.pl is completely
> overridden, the code block has to be written completely as
> it were in a plain bison grammar
> b) "rule" - the automatic rule is extended on, so new syntaxes
> are accepted for "ruleA". E.g.:
> ECPG: ruleAtokenAtokenBtokenC rule
> | tokenD tokenE { action_code; }
> ...
> It will be substituted with:
> ruleA: <original syntax forms and actions up to and including
> "tokenA tokenB tokenC">
> | tokenD tokenE { action_code; }
> ...
> c) "addon" - the automatic action for the rule (SQL syntax constructed
> from the tokens concatenated together) is prepended with a new
> action code part. This code part is written as is's already inside
> the { ... }
>
> Multiple "addon" or "block" lines may appear together with the
> new code block if the code block is common for those rules, which
> is a very smart thing.
>
> This was what I gathered from the code. The documentation
> seems to be missing from the rewritten ECPG grammar in 8.4.
> Michael, am I missing something?
>
> Dan, please, start the review in light of the above.
> If you have any questions, don't hesitate to ask.
Please move this discussion to -hackers, maybe with a link back to
this post. Good info, wrong place. :-)
...Robert
----- End forwarded message -----
I'm bumping this message to pg-hackers.
Here is a link to the archive as well:
http://archives.postgresql.org/pgsql-rrreviewers/2009-09/msg00039.php
--
--Dan
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Browne | 2009-09-28 16:55:32 | Re: 8.5 TODO: Add comments to output indicating version of pg_dump and of the database server |
Previous Message | Pavel Stehule | 2009-09-28 16:23:20 | Re: Issues for named/mixed function notation patch |