From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgresql.org
Cc: Joe Van Dyk <joe@tanga.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: [HACKERS] ltree::text not immutable?
Date: Sun, 26 Oct 2014 23:12:10 -0500
Message-ID: <544DC61A.6090604@BlueTreble.com> (raw)
In-Reply-To: <11194.1414356373@sss.pgh.pa.us>
References: <CACfv+pL2oX08SSZSoaHpyC=UbfTFmPt4UmVEKJTH7y=2QMRCBw@mail.gmail.com>
<11863.1414092704@sss.pgh.pa.us>
<13790.1414094087@sss.pgh.pa.us>
<11194.1414356373@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Jim.Nasby@BlueTreble.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org, joe@tanga.com
Subject: Re: [HACKERS] ltree::text not immutable?
In-Reply-To: <544DC61A.6090604@BlueTreble.com>
References: <CACfv+pL2oX08SSZSoaHpyC=UbfTFmPt4UmVEKJTH7y=2QMRCBw@mail.gmail.com> <11863.1414092704@sss.pgh.pa.us> <13790.1414094087@sss.pgh.pa.us> <11194.1414356373@sss.pgh.pa.us> <544DC61A.6090604@BlueTreble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox