Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Date
Msg-id CAM3SWZTiVOu3qOuaEri8G4VqEFf_w2auLMPZeCBVYCpChR8Wmw@mail.gmail.com
Whole thread Raw
In response to BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres  (onderkalaci@gmail.com)
Responses Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
List pgsql-bugs
On Tue, Jan 26, 2016 at 4:34 AM,  <onderkalaci@gmail.com> wrote:
>
> I guess the problem is on this line (ruletils@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

pgsql-bugs by date:

Previous
From: onderkalaci@gmail.com
Date:
Subject: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Next
From: Tatsuo Ishii
Date:
Subject: Re: Encoding problems with "COMMENT ON DATABASE .." causing pg_restore (and pg_upgrade) to fail