Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk7g3-000788-SZ for pgsql-general@arkaria.postgresql.org; Thu, 28 Apr 2022 17:11:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nk7g2-0002og-L3 for pgsql-general@arkaria.postgresql.org; Thu, 28 Apr 2022 17:11:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk7g2-0002oW-5b for pgsql-general@lists.postgresql.org; Thu, 28 Apr 2022 17:11:38 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nk7fv-0003SW-7B for pgsql-general@lists.postgresql.org; Thu, 28 Apr 2022 17:11:37 +0000 Received: by mail-qt1-x830.google.com with SMTP id t16so3949493qtr.9 for ; Thu, 28 Apr 2022 10:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=americanefficient-com.20210112.gappssmtp.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=9g0/S1QOLtdgAH7DRxQRSUPr0RJKKNz2dXyBXmzZzfY=; b=dfk3CLsrVkTvONViKWhNkeGZs0EqO8/DcS8LetijO+iPIc4PS7EBpVYMHT9twlBjVh ztjWq9W2enFCTM9nfsVE2UPi25rfdY0ZSFQZs1s7OONaTtHkYUHTCFrzDFiA4zOd8mqQ R9zESMc0tdGgcSN0/1eRfi7rdFaj1LCz5rog57VZ+JbkNFntwLsTomx0sua5ACvorI3p iEA2kP5SZfeyq88ju574rp4e3Z9R3B1ht2UjMST5MygWgdJ6YOkCvpNpdHo3HCOyPrTi H6yFtwYUHrkKue6dxZJum9RYsQ4k4SoDR9c302rnrIrUX/dccef21SyA+sjAXNS6PgLF 4jxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=9g0/S1QOLtdgAH7DRxQRSUPr0RJKKNz2dXyBXmzZzfY=; b=Qqcm1FVrdnSbcyYHELwwAkODGF0fUlxj3XtqGDU4irp2EIT1MItzGQd+E4nw4AVj51 9elsD+n6xb0+UDhk9vPr3ktQqGxnnoNU5rdZmtPVlx54AvA+XnqKPEZKHx0FJcJaO3Yy p9C7rNCPfh6XRG2q5Gjd1fME531ERE8qUXvY6xgwgOEftV7QE65Ut1EBNO6jSuP3R6EO EY3T55SNBPzFq2Kt7VCCBiOcvWIUJSnt+oxRfYNlqcM5CAH87VJVBvvmxV61L1MoYNwt 8GxZEyad6X6+/GY0TKMIWl9y8w/5M+x+6RWahBeymPdn6XOZDnDOyF6PMxRDIrXP0Qfw pwCg== X-Gm-Message-State: AOAM532yqjo790gIFtHbxk+2d6TVjT8HcGmRLPNTT/9TkzUIgkGZ4Fc9 ohB042ZxxwsNEOoVaF/bljZETCeNVD1+SqUGjdQYHjAxxxcaxnb7AQbDl404PmBDGDtvfgDe1Nc WxIJM+ZMXlbIUVtajBfLhExcxL1Ogq9203KxKDt8Nxr9xzASdBaNK+hOsVHqMhnZ6/rYPireaDu vJSdZb2RpzCdN43zFUytqIaQ== X-Google-Smtp-Source: ABdhPJwfBhidz56OIVpPhubu4G7WXwdeLpIAuegeAf9dtoo6vxhqzai/CAToUhMmB8DSEijedaJE2g== X-Received: by 2002:a05:622a:105:b0:2e1:d653:c325 with SMTP id u5-20020a05622a010500b002e1d653c325mr23864298qtw.75.1651165889061; Thu, 28 Apr 2022 10:11:29 -0700 (PDT) Received: from smtpclient.apple (cpe-24-211-149-51.nc.res.rr.com. [24.211.149.51]) by smtp.gmail.com with ESMTPSA id 2-20020ac84e82000000b002f1f95ce5fbsm332885qtp.3.2022.04.28.10.11.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2022 10:11:28 -0700 (PDT) From: Philip Semanchuk Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Could Postgres warn about incorrect volatility class? Message-Id: <5EB0EA00-DDFC-466C-88EE-F2230065EC24@americanefficient.com> Date: Thu, 28 Apr 2022 13:11:28 -0400 To: PostgreSQL General X-Mailer: Apple Mail (2.3696.80.82.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi all, I recently discovered that a custom function that I thought was being = inlined was not being inlined because I had declared it IMMUTABLE, but = the function body cast an enum value to text which is a STABLE operator. = Once I corrected my function's definition to declare it STABLE, Postgres = inlined it.=20 Since Postgres can apparently determine during query parsing that my = function has a volatility class mismatch, is there a reason that = Postgres can't make the same determination and inform me about it when I = define the function? In this case a helpful message would have been "I = sure hope you know what you're doing..." :-) Thanks=20 Philip=