Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWoJP-0000wC-QP for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jul 2017 18:30:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dWoJO-0002QW-4l for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jul 2017 18:30:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dWoIg-000179-Js for pgsql-bugs@postgresql.org; Sun, 16 Jul 2017 18:29:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dWoId-0006bw-LE for pgsql-bugs@postgresql.org; Sun, 16 Jul 2017 18:29:49 +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 v6GITj9x009163; Sun, 16 Jul 2017 14:29:45 -0400 From: Tom Lane To: 007reader@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable In-reply-to: <20170716181004.9231.22003@wrigleys.postgresql.org> References: <20170716181004.9231.22003@wrigleys.postgresql.org> Comments: In-reply-to 007reader@gmail.com message dated "Sun, 16 Jul 2017 18:10:04 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9161.1500229785.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 16 Jul 2017 14:29:45 -0400 Message-ID: <9162.1500229785@sss.pgh.pa.us> 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 007reader@gmail.com writes: > According to https://www.postgresql.org/about/news/1763/ Beta 2 marked > to_tsvector(regconfig, json[b]) immutable, but it still doesn't work, at > least in the docker version of Beta 2. Here is the result: > create table test (j JSON, jb JSONB); > CREATE TABLE > create index j_ixd on test using gin(to_tsvector(j)); > ERROR: functions in index expression must be marked IMMUTABLE > create index jb_ixd on test using gin(to_tsvector(jb)); > ERROR: functions in index expression must be marked IMMUTABLE Um, but that's not the two-argument version of to_tsvector. You need something like regression=3D# create index j_ixd on test using gin(to_tsvector('english', = j)); CREATE INDEX regression=3D# create index j_ixd2 on test using gin(to_tsvector('english',= jb)); CREATE INDEX The point here is that the single-argument versions are affected by the configuration setting default_text_search_config, so they can't be used in an index. Nailing down which tsconfig to use makes them indexable. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs