Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEKh2-0006YG-F4 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2017 19:14:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dEKh1-00048v-B4 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2017 19:14:35 +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_2) (envelope-from ) id 1dEKh0-00046x-Ft for pgsql-hackers@postgresql.org; Fri, 26 May 2017 19:14:34 +0000 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dEKgw-0002Gn-Q3 for pgsql-hackers@postgresql.org; Fri, 26 May 2017 19:14:33 +0000 Received: by mail-qk0-x232.google.com with SMTP id u75so14572192qka.3 for ; Fri, 26 May 2017 12:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pcorp-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=MQ/mbiux7RfhHDrXBkTcnO9z0IGDW5sBb/Y/5NZCmrc=; b=0HIk3eMomU/VravF59prSfQxmsClDMpfWzVjwOHhs3T4sAocB16LMqOCwTgnZ4MXFD QMFt009UvBoT7r3dkfGRTNmH/g+ykS2UoaCdwDRBoj6E35idFyUZRMACgLBbSM/BHL5s KJRGGDWu49RwHcixq4fM5BL2LZMZapNYOx9X2+RllGOyBFOmVezcOSC4+nRuL6Xt9bMi YKASfUXsIhF8cbGz+zGhLt+yKqoSuDhJaQL3wiTT3plYThKeOnY5XO2K7NhtvnuJvaTt xPMD99QNnTFf/I1ZMjCdEprMSp/ijPi9Ex1GB8LFJnAS8DziTArOLjSJr7pYHxMaI0R0 qU8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=MQ/mbiux7RfhHDrXBkTcnO9z0IGDW5sBb/Y/5NZCmrc=; b=sz5l9DyNBCY3Tdu9kVhZjr/Ql6lGJG9XTCxBfLkl34oGie2+OBazyAsnmbRxHisR7J dv4FabWJKXTGm416kAnP5oSyBpXcbZx/8f64+OT+nh1lrpLgU8ns6k/BD8zVeKRHhqN1 sNpikRKLA/SZxbuWKlQPotBvyI1ka77NP4fJvgV9fql932rwDL683MvP1fx+xykedAQz RLx4qhfgeCWH5rXP0/cRqVU5G2zyW6XXxfef2KRURZodTLAC5YQSOr/zWzHoYScuHcqh tD/MfhINd6KSNZYCFRBFLCUpdIcwKQiN24rjphbtTOWN6rC/mcPmHVI2QjKYOGENz0wo pnGQ== X-Gm-Message-State: AODbwcAolj0ayy9eRvySFo1GtW4f9IBfLlZ7djbrLJIwKYkZHwmU/yuR CgnembtGC0Ti4jPNcYw= X-Received: by 10.55.105.133 with SMTP id e127mr4015979qkc.19.1495826069183; Fri, 26 May 2017 12:14:29 -0700 (PDT) Received: from R (50-78-240-110-static.hfc.comcastbusiness.net. [50.78.240.110]) by smtp.gmail.com with ESMTPSA id v17sm1097138qtc.3.2017.05.26.12.14.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 May 2017 12:14:28 -0700 (PDT) From: "Regina Obe" To: "'Tom Lane'" Cc: "'PostgreSQL-development'" References: <000001d2d5de$d8d66170$8a832450$@pcorp.us> <29994.1495809534@sss.pgh.pa.us> In-Reply-To: <29994.1495809534@sss.pgh.pa.us> Subject: Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity Date: Fri, 26 May 2017 15:14:37 -0400 Message-ID: <000c01d2d654$518f2be0$f4ad83a0$@pcorp.us> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGSyGid0WOb7K33IPoK2k+QsEQaEAKr4LhqonG3S4A= Content-Language: en-us X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org > "Regina Obe" writes: >> I figured out the culprit was the change in CASE WHEN behavior with >> set returning functions Had a criteria something of the form: >> CASE WHEN some_condition_dependent_on_sometable_that_resolves_to_false >> THEN (regexp_matches(...))[1] ELSE ... END FROM sometable; > You might want to consider changing such usages to use regexp_match() instead of regexp_matches(). > regards, tom lane Thanks. I ended up swapping out with substring which was a bit shorter than regexp_match()[]. But I've got similar problems with PostGIS topology logic and the easiest change to make was take advantage of the fact that you guys are treating CASE constant ... THEN SRF ... Differently Than CASE not_constant_based_on_table_value THEN SRF .. So I switched those to constant checks. This feels a little dirty and fragile to me though. Is this behavior going to stay or change? It seems inconsistent from a user perspective that CASE constant .... == short-circuit skipping over SRFs that may otherwise fail While CASE not_constant_table_dependent doesn't short-circuit. I can understand the motive behind it, it just feels a little inconsistent from an end-user POV. Thanks, Regina -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers