Re: Doubt in parser - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Doubt in parser
Date
Msg-id 20060216124556.GD26127@svana.org
Whole thread Raw
In response to Doubt in parser  (Dhanaraj <Dhanaraj.M@Sun.COM>)
List pgsql-hackers
On Thu, Feb 16, 2006 at 06:07:25PM +0530, Dhanaraj wrote:
> hi
>
> currently i looking at the postgres src code. I saw the scanner and
> parser implemetations at two different places (src/backend/parser/  and
> /src/bakend/bootstrp). Can anybody tell me the purpose of having two
> phases?? or will this help to parse the queries at different levels?

The first one is the actual parser for queries you send. The latter is
the bootstrap parser which is only used during the inital bootstrap of
a database. It needs to be seperate because of things like the names of
columns are stored in a pg_attribute, yet how can you fill the table if
you don't know what the columns are called.

The latter is basically a glorified data loader to handle this special
case. It can't do queries or anything like that. You can basically
ignore it for normal development.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Dhanaraj
Date:
Subject: Doubt in parser
Next
From: Martijn van Oosterhout
Date:
Subject: Re: qsort again