Re: Is there anyway to get list of table name, before raw parser is analyze?

From: Mohammad Heykal Abdillah <heykal(dot)abdillah(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is there anyway to get list of table name, before raw parser is analyze?
Date: 2010-05-30 05:43:25
Message-ID: 1275198205.14994.18.camel@claudia
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Min, 2010-05-30 at 00:44 -0400, Andrew Dunstan wrote:
>
> Mohammad Heykal Abdillah wrote:
> > Hi all,
> >
> > Right now i am trying to understand how SQL parser is work.
> >
> > My question is there anyway to get list of table name and its atribut
> > before raw parser is analyze?
> >
> > Because i like to understand how PostgreSQL "break-down" the asterik at
> > target list, specialy in "natural join" case where PostgreSQL can give
> > query result that have unabigous attribut and match the right join key.
> >
> >
> >
>
> AIUI, expanding '*' is not done in the parser. The parser just makes an
> A_star node.
>
> See src/backend/gram.y for the parser spec.
>
> Maybe you need to explain what exactly you're trying to do.
>
> cheers
>
> andrew

Yes that i know, expanding '*' is done in analyzer part. I am try to do
is, move the expanding process to "before" raw_parser that produce by
gram.y is processed by analyzer. Like this :

sql query -> gram.y -> raw_parse_tree -> (expand the '*') -> analyze

In this way analyzer part only receiving the expanded '*' parse tree
they wont expand the '*' again. I am aksing this because i didnt know
how to (analyzer) scan database so it can return list of attribut from
table. I have read the source code, and try manualy to replicate the
process (from what i got is the RTE function) with no result.

Thank You.
--
Mohammad Heykal Abdillah <heykal(dot)abdillah(at)gmail(dot)com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Krogh 2010-05-30 07:08:32 Re: tsvector pg_stats seems quite a bit off.
Previous Message Andrew Dunstan 2010-05-30 04:44:22 Re: Is there anyway to get list of table name, before raw parser is analyze?