Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xibfa-0001Zy-Iy for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2014 04:12:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XibfZ-0002rf-Ui for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2014 04:12:37 +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 1XibfY-0002rU-DL; Mon, 27 Oct 2014 04:12:36 +0000 Received: from mail-bn1on0667.outbound.protection.outlook.com ([2a01:111:f400:fc10::667] helo=na01-bn1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XibfT-0000Sg-N1; Mon, 27 Oct 2014 04:12:34 +0000 Received: from decina.attlocal.net (108.232.179.70) by BN3PR11MB0177.namprd11.prod.outlook.com (25.160.185.156) with Microsoft SMTP Server (TLS) id 15.1.6.9; Mon, 27 Oct 2014 04:12:20 +0000 Message-ID: <544DC61A.6090604@BlueTreble.com> Date: Sun, 26 Oct 2014 23:12:10 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Tom Lane , CC: Joe Van Dyk , "pgsql-bugs@postgresql.org" Subject: Re: [HACKERS] ltree::text not immutable? References: <11863.1414092704@sss.pgh.pa.us> <13790.1414094087@sss.pgh.pa.us> <11194.1414356373@sss.pgh.pa.us> In-Reply-To: <11194.1414356373@sss.pgh.pa.us> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [108.232.179.70] X-ClientProxiedBy: BY2PR07CA044.namprd07.prod.outlook.com (10.141.251.19) To BN3PR11MB0177.namprd11.prod.outlook.com (25.160.185.156) X-MS-Exchange-Transport-FromEntityHeader: Hosted X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN3PR11MB0177; X-Forefront-PRVS: 0377802854 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(51704005)(199003)(189002)(479174003)(377454003)(24454002)(65806001)(101416001)(65956001)(64706001)(20776003)(47776003)(42186005)(80022003)(102836001)(46102003)(122386002)(54356999)(95666004)(76176999)(40100003)(33656002)(106356001)(105586002)(107046002)(65816999)(31966008)(21056001)(53416004)(23756003)(77096002)(83506001)(97736003)(86362001)(92566001)(92726001)(50466002)(120916001)(15975445006)(19580395003)(76482002)(36756003)(87976001)(80316001)(85852003)(50986999)(87266999)(66066001)(4396001)(15202345003)(85306004)(93886004)(551544002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR11MB0177; H:decina.attlocal.net; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-OriginatorOrg: bluetreble.com X-Pg-Spam-Score: -1.9 (-) 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 10/26/14, 3:46 PM, Tom Lane wrote: > 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. The check could explicitly ignore chkpass_in. That's pretty grotty, but perhaps less so than marking it stable when it's not... -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs