public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Andrew Dunstan <[email protected]>
Cc: Jacob Champion <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Jelte Fennema-Nio <[email protected]>
Subject: Re: how to gate experimental features (SQL/PGQ)
Date: Thu, 15 Jan 2026 12:31:35 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<cwthrfgp2foh64aylx6wkcl2v2543qlqxztgkg6pwscqum7jw7@oyf57d3x46fu>
	<CAOYmi+mAYpUZdxjc6pd-iW+uk4ShbLatAV-KhbDJR+xcCBQL2w@mail.gmail.com>
	<[email protected]>
	<[email protected]>

Andrew Dunstan <[email protected]> writes:
> On 2026-01-13 Tu 12:24 PM, Tom Lane wrote:
>> You'd have to throw out flex and bison and build some sort of
>> extensible parser.  That has some attraction to me personally
>> (I worked on such systems decades ago at HP), but it's fairly
>> hard to justify the amount of effort that would be needed to
>> get there.  It might well be slower than a flex/bison parser,
>> and/or have poorer detection of grammar inconsistencies, either
>> of which would be bad for our usage.

> Maybe, but maybe not. ISTR that gcc abandoned use of bison for their C 
> compiler a long time ago, and that gnat's Ada compiler was hand cut from 
> the get go.
> SQL is a different kettle of fish, of course - it dwarfs C and Ada in 
> complexity.

Yeah.  And we have additional problems besides the grammar being far
larger than it is for those projects:

* It's a moving target (to a much greater degree than C, anyway).

* A lot of our code is written by people who are not parser experts.

So it gives me great comfort that bison will complain if you hand it
an ambiguous or unsatisfiable grammar.  If we went over to a
handwritten parser, I'd have next to no faith in it not being buggy.
There's good reasons why people put so much effort into parser
generators back in the day.

			regards, tom lane






view thread (5+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: how to gate experimental features (SQL/PGQ)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox