Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 836B665239B for ; Tue, 22 May 2012 23:15:02 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SX16L-0001ZA-ON for pgsql-bugs@postgresql.org; Wed, 23 May 2012 02:15:02 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q4N2Eme9018763; Tue, 22 May 2012 22:14:48 -0400 (EDT) To: Maxim Boguk cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6662: Database do not push condition to subquery, test case for bug 6658 In-reply-to: References: <18199.1337737564@sss.pgh.pa.us> Comments: In-reply-to Maxim Boguk message dated "Wed, 23 May 2012 11:53:37 +1000" Date: Tue, 22 May 2012 22:14:48 -0400 Message-ID: <18762.1337739288@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/165 X-Sequence-Number: 33136 Maxim Boguk writes: > if anytextcat() and textanycat() are marked volatile, > why the database allows create index on supposedly to be volatile > expression: > create index test_val_special on test((val || '')); CREATE INDEX inlines anytextcat (which is just a SQL function) before making the volatility test, cf commit 5a86e5e19. The reason the subselect flattening code has difficulty with this case is that that happens before function inlining does, so the expression still looks volatile even though it really isn't. regards, tom lane