Re: TODO question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TODO question
Date
Msg-id 18847.1009644879@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO question  ("Pavlo Baron" <pb@pbit.org>)
List pgsql-hackers
"Pavlo Baron" <pb@pbit.org> writes:
> I see. Can I say in simple words, that everything that can be parsed without
> any knowledge about the database condition has to be pre-parse-analized and
> the rest has to be post-parse-analized, then?

Exactly.  The grammar phase has to operate without examining the
database, because it needs to be able to run even in transaction-aborted
state (so we can recognize COMMIT and ROLLBACK commands).  Parse
analysis does the lookups and so forth to determine exactly what the
raw syntax tree really means.

> summary (if any) where I would find a rough desc. on such distinction?

There's no substitute for reading the code ... the point above is
mentioned in the comments at the head of gram.y, for example.

> BTW, what about constructs like:
> INSERT INTO foo VALUES (1,,2);
> wouldn't it make the whole thing a bit simpler?

Maybe, but it's not SQL92.  Looks kind of error-prone to me anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: text -> time cast problem
Next
From: Thomas Lockhart
Date:
Subject: Updated date/time parsing