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

From Andres Freund
Subject Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Date
Msg-id 20160204121141.bl3dbdnv2vipl4j5@alap3.anarazel.de
Whole thread Raw
In response to Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres  (Peter Geoghegan <pg@heroku.com>)
Responses Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres  (Peter Geoghegan <pg@heroku.com>)
List 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

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres