Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1D5C31337B83 for ; Sat, 4 Dec 2010 13:30:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 78935-01 for ; Sat, 4 Dec 2010 17:30:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id D533B1337B77 for ; Sat, 4 Dec 2010 13:30:44 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oB4HUg8N024719; Sat, 4 Dec 2010 12:30:42 -0500 (EST) To: Greg Stark cc: Grant Hutchins and Peter Jaros , pgsql-bugs@postgresql.org Subject: Re: BUG #5781: unaccent() function should be marked IMMUTABLE In-reply-to: References: <201012021544.oB2FiTn1041521@wwwmaster.postgresql.org> <16472.1291351806@sss.pgh.pa.us> Comments: In-reply-to Greg Stark message dated "Sat, 04 Dec 2010 14:45:58 +0000" Date: Sat, 04 Dec 2010 12:30:42 -0500 Message-ID: <24718.1291483842@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/24 X-Sequence-Number: 28830 Greg Stark writes: > On Fri, Dec 3, 2010 at 4:50 AM, Tom Lane wrote: >> Even if you're willing to >> assume that the dictionary being used is the one defined by this >> module, that dictionary depends on external configuration files >> which are easily changeable. > Don't we have precedent for this in assuming that things like tsearch > dictionaries and parsers and system locales don't change underneath > us? The precedent is to assume such things are stable, not immutable. Even if you want to assume that, the implementation of unaccent(text) is such that its results depend on search_path, which is *definitely* not acceptable for an immutable function. It would need a better way of tying the function to the dictionary. regards, tom lane