Re: Understanding Rule System

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Juan Pablo Espino <jp(dot)espino(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Understanding Rule System
Date: 2005-05-11 23:44:06
Message-ID: c2d9e70e050511164421fcb6e7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/11/05, Juan Pablo Espino <jp(dot)espino(at)gmail(dot)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 ;)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2005-05-11 23:52:16 Re: New Contrib Build?
Previous Message Andrew Dunstan 2005-05-11 22:28:57 Re: New Contrib Build?