Re: Eliminating pg_catalog.pg_rewrite.ev_attr - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Eliminating pg_catalog.pg_rewrite.ev_attr
Date
Msg-id 20130904161253.GE5227@eldon.alvh.no-ip.org
Whole thread Raw
In response to Eliminating pg_catalog.pg_rewrite.ev_attr  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-hackers
Is this transformation correct?  If I read this correctly, you're
missing the rangeTableEntry_used() condition, no?

> *** a/src/backend/rewrite/rewriteHandler.c
> --- b/src/backend/rewrite/rewriteHandler.c
> ***************
> *** 1273,1287 **** matchLocks(CmdType event,
>               }
>           }
>   
> !         if (oneLock->event == event)
> !         {
> !             if (parsetree->commandType != CMD_SELECT ||
> !                 (oneLock->attrno == -1 ?
> !                  rangeTableEntry_used((Node *) parsetree, varno, 0) :
> !                  attribute_used((Node *) parsetree,
> !                                 varno, oneLock->attrno, 0)))
> !                 matching_locks = lappend(matching_locks, oneLock);
> !         }
>       }
>   
>       return matching_locks;
> --- 1273,1280 ----
>               }
>           }
>   
> !         if (oneLock->event == event && parsetree->commandType != CMD_SELECT)
> !             matching_locks = lappend(matching_locks, oneLock);
>       }
>   
>       return matching_locks;



-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)
Next
From: Jeff Davis
Date:
Subject: Re: [9.4] Make full_page_writes only settable on server start?