Re: Understanding Rule System - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: Understanding Rule System
Date
Msg-id c2d9e70e050511164421fcb6e7@mail.gmail.com
Whole thread Raw
In response to Understanding Rule System  (Juan Pablo Espino <jp.espino@gmail.com>)
List pgsql-hackers
On 5/11/05, Juan Pablo Espino <jp.espino@gmail.com> wrote:
> Hello all
>
> I have been studying the rule system in Postgres.  I understand that
> the original query tree is the input at the rewrite, and then this
> query tree is modified by the rewrite in case that there is a rule.
>
> SQL query ----> Parser ----> Rewrite ----> Planner ----> Executor
>                                   ^^^^            ^^^^
>                                  Query         New Query
>                                 tree            tree
>
> I would like to know how the rewrite detects that a rule in a table
> exists, and if it possible you indicate me where in the source code
> it's implemented.  Any comments are welcome, thanks in advance.
>
src/backend/rewrite/*.c       The entry point i think is rewriteHandler.c

IIRC, there is a catalog that is used to know if there are any rules
for a table i think it is pg_rewrite, but i can be wrong.

--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: New Contrib Build?
Next
From: Peter Eisentraut
Date:
Subject: Re: New Contrib Build?