Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS
Date: 2017-06-21 02:02:10
Message-ID: 20170621020210.eqf44aoqjcu3qtma@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Bruno Wolff III wrote:
> I'm not seeing an obvious error in my attempt to use CREATE STATISTICS IF
> NOT EXISTS. Given this is new, maybe there is a bug in the parser.

You're absolutely right, and this is a bug in the parser -- I probably
misplaced the IF NOT EXISTS clause while playing with Tomas' parser
changes. Here's the fix. I'm a bit troubled that this change doesn't
seem to affect any tests, so I'll add some before pushing.

(Now, "statistics" being plural would seem to call for CREATE STATISTICS
IF NOT EXIST, rather than EXISTS, but I'll put that thought aside on
account of it being just too weird ...)

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-fix-create-stats-grammar.patch text/plain 1.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2017-06-21 02:12:51 Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS
Previous Message Tom Lane 2017-06-21 02:01:06 Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-06-21 02:12:51 Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS
Previous Message Tom Lane 2017-06-21 02:01:06 Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS