Re: Notes on testing Postgres 10b1

From: Josh Berkus <josh(at)berkus(dot)org>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Notes on testing Postgres 10b1
Date: 2017-06-10 18:33:48
Message-ID: 991b4b0e-03d7-d005-a67d-48fe3912f216@berkus.org
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On 06/09/2017 07:54 PM, Greg Stark wrote:
> On 7 June 2017 at 01:01, Josh Berkus <josh(at)berkus(dot)org> wrote:
>> P3: apparently jsonb_to_tsvector with lang parameter isn't immutable?
>> This means that it can't be used for indexing:
>>
>> libdata=# create index bookdata_fts on bookdata using gin ((
>> to_tsvector('english',bookdata)));
>> ERROR: functions in index expression must be marked IMMUTABLE
>
> I don't have a machine handy to check on but isn't this a strange
> thing to do? Isn't there a GIN opclass on jsonb itself which would be
> the default if you didn't have that to_tsvector() call -- and which
> would also work properly with the jsonb operators?
>

The above is the documented way to create an FTS index on a JSONB field.

--
Josh Berkus
Containers & Databases Oh My!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2017-06-10 22:20:26 memory fields from getrusage()
Previous Message Alvaro Herrera 2017-06-10 18:04:19 Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity