Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: onderkalaci(at)gmail(dot)com
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Date: 2016-01-26 20:29:55
Message-ID: CAM3SWZTiVOu3qOuaEri8G4VqEFf_w2auLMPZeCBVYCpChR8Wmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 26, 2016 at 4:34 AM, <onderkalaci(at)gmail(dot)com> wrote:
>
> I guess the problem is on this line (ruletils(at)5533 on Postgresql 9.5.0
> source)
> https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/ruleutils.c#L5533
>
> I think, postgres should set varprefix to false before calling
> get_rule_expr().

I believe that your analysis is correct. I'll need to look into it in
more detail, but I'm about to get on a transatlantic flight.

I'm curious: How did you find this bug? Did you just stumble upon it?

I think that the deeper problem here may be that parse analysis of the
inference WHERE clause works by reusing infrastructure from CREATE
INDEX. We should consider that there may be further consequences to
that (although there may well not be).

Does the rewritten query actually error? In other words, is your
complaint strictly that deparsing is broken?

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2016-01-27 00:45:10 Re: Encoding problems with "COMMENT ON DATABASE .." causing pg_restore (and pg_upgrade) to fail
Previous Message Dennis Kögel 2016-01-26 18:21:31 Parallel pg_restore fails to import views with triggers (dependency problem?)