Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XiUhg-0001Jn-Ux for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Oct 2014 20:46:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XiUhf-0007OC-Ih for pgsql-bugs@arkaria.postgresql.org; Sun, 26 Oct 2014 20:46:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XiUhe-0007O1-4x; Sun, 26 Oct 2014 20:46:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XiUhb-0000x9-Bm; Sun, 26 Oct 2014 20:46:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s9QKkDrO011195; Sun, 26 Oct 2014 16:46:13 -0400 From: Tom Lane To: pgsql-hackers@postgresql.org cc: Joe Van Dyk , "pgsql-bugs@postgresql.org" Subject: Re: ltree::text not immutable? In-reply-to: <13790.1414094087@sss.pgh.pa.us> References: <11863.1414092704@sss.pgh.pa.us> <13790.1414094087@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 23 Oct 2014 15:54:47 -0400" Date: Sun, 26 Oct 2014 16:46:13 -0400 Message-ID: <11194.1414356373@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 I wrote: >> More generally, it seems like we ought to have a test in the type_sanity >> regression script that checks that type I/O functions aren't volatile, >> ... > Actually, the right thing to do if we want to enforce this is for > CREATE TYPE to check the marking. We'd still need a type_sanity > test to check erroneous declarations of built-in types, but a complaint > in CREATE TYPE would cover all the contrib modules as well as third-party > code. > I wouldn't propose back-patching such an error check, but it seems > reasonable to add it for 9.5. Any objections? On the way to fixing this, I was unpleasantly surprised to discover that we have one I/O function in contrib that *actually is* volatile, and not just thoughtlessly marked that way. That's chkpass_in(), which is volatile because it goes to the trouble of using random() to produce a new password salt value on every call. Not entirely sure what to do about this. It seems like for the purposes of contrib/chkpass, it's a good thing that chkpass_in() won't reuse the same salt. Weak as a 12-bit salt might be nowadays, it's still better than no salt. Nonetheless, this behavior is breaking assumptions made in places like array_in and record_in. For the moment I'm tempted to mark chkpass_in as stable (with a comment explaining that it isn't really) just so we can put in the error check in CREATE TYPE. But I wonder if anyone has a better idea. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs