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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Önder Kalacı <onderkalaci(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Date: 2016-02-04 12:11:41
Message-ID: 20160204121141.bl3dbdnv2vipl4j5@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2016-02-04 04:02:04 -0800, Peter Geoghegan wrote:
> --- a/src/test/regress/expected/rules.out
> +++ b/src/test/regress/expected/rules.out
> @@ -2846,7 +2846,7 @@ SELECT definition FROM pg_rules WHERE tablename = 'hats' ORDER BY rulename;
> CREATE RULE hat_nosert AS +
> ON INSERT TO hats DO INSTEAD INSERT INTO hat_data (hat_name, hat_color) +
> VALUES (new.hat_name, new.hat_color) ON CONFLICT(hat_name COLLATE "C" bpchar_pattern_ops)+
> - WHERE (hat_data.hat_color = 'green'::bpchar) DO NOTHING +
> + WHERE (hat_color = 'green'::bpchar) DO NOTHING +
> RETURNING hat_data.hat_name, +
> hat_data.hat_color;
> (1 row)
> @@ -2871,7 +2871,7 @@ SELECT tablename, rulename, definition FROM pg_rules
> hats | hat_nosert | CREATE RULE hat_nosert AS +
> | | ON INSERT TO hats DO INSTEAD INSERT INTO hat_data (hat_name, hat_color) +
> | | VALUES (new.hat_name, new.hat_color) ON CONFLICT(hat_name COLLATE "C" bpchar_pattern_ops)+
> - | | WHERE (hat_data.hat_color = 'green'::bpchar) DO NOTHING +
> + | | WHERE (hat_color = 'green'::bpchar) DO NOTHING +
> | | RETURNING hat_data.hat_name, +
> | | hat_data.hat_color;
> (1 row)

Can you add code to execute the resulting statements? Because obviously
just seeing the output ain't enough. Seems like an easily repeatable
error, and the regression test scase ought to be pretty easy with a DO
and a loop.

Andres

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Kapila 2016-02-04 12:51:41 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Previous Message Peter Geoghegan 2016-02-04 12:02:04 Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres