Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aRIlu-0005TB-Lj for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Feb 2016 12:12:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aRIlu-00048A-7b for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Feb 2016 12:12:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aRIlH-0003Rl-Nm for pgsql-bugs@postgresql.org; Thu, 04 Feb 2016 12:11:47 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aRIlF-0000m2-Bj for pgsql-bugs@postgresql.org; Thu, 04 Feb 2016 12:11:46 +0000 Received: from intern.anarazel.de (unknown [195.91.159.131]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 8A8BB860001; Thu, 4 Feb 2016 13:11:44 +0100 (CET) Date: Thu, 4 Feb 2016 13:11:41 +0100 From: Andres Freund To: Peter Geoghegan Cc: =?utf-8?B?w5ZuZGVyIEthbGFjxLE=?= , pgsql-bugs Subject: Re: BUG #13891: Deparsed arbiter WHERE clauses cannot be parsed by Postgres Message-ID: <20160204121141.bl3dbdnv2vipl4j5@alap3.anarazel.de> References: <20160126123420.2539.85100@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs