Re: Re: [PATCHES] Select parser at runtime

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ian Lance Taylor <ian(at)airs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCHES] Select parser at runtime
Date: 2001-08-12 21:22:35
Message-ID: 200108122122.f7CLMZS15398@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > Ian Lance Taylor <ian(at)airs(dot)com> writes:
> > > For example: the datatypes have different names; the set of reserved
> > > words is different; Oracle uses a weird syntax for outer joins.
> >
> > Is it really possible to fix these things strictly in the parser
> > (ie, without any semantic analysis)? For example, I don't quite see
> > how you're going to translate Oracle-style outer joins to SQL standard
> > style without figuring out which fields belong to which relations.
> > Keep in mind the cardinal rule for the parsing step: Thou Shalt Not
> > Do Any Database Access (because the parser must work even in
> > transaction-aborted state, else how do we recognize ROLLBACK command?)
>
> I admit that I haven't sorted out the outer join thing yet. The
> others are easy enough.
>

Another idea is to put the Oracle stuff in gram.y, but use #ifdef or
something to mark the Oracle parts, and run gram.y through yacc/bison
with the Oracle defines visiable, and another time to create a second
parse state machine without Oracle. I think Jan did that for something
like that once.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-12 21:38:05 Re: Bug with ALTER TABLE
Previous Message Darren Johnson 2001-08-12 21:13:44 Re: Re: Comparing tables in different db's

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-08-12 22:02:13 Re: bytea_ops
Previous Message Joe Conway 2001-08-12 19:44:38 Re: bytea_ops