Re: [HACKERS] jsonb_to_tsvector should be immutable - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] jsonb_to_tsvector should be immutable
Date
Msg-id 6167.1496946418@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] jsonb_to_tsvector should be immutable  (Josh Berkus <josh@berkus.org>)
Responses Re: [HACKERS] jsonb_to_tsvector should be immutable
List pgsql-hackers
Josh Berkus <josh@berkus.org> writes:
> select proname, prosrc, proargtypes, provolatile from pg_proc where
> proname = 'to_tsvector';

Slightly more readable version:

regression=# select oid::regprocedure, provolatile, proparallel from pg_proc where proname = 'to_tsvector';
oid             | provolatile | proparallel  
------------------------------+-------------+-------------to_tsvector(jsonb)           | s           |
sto_tsvector(regconfig,text) | i           | sto_tsvector(text)            | s           | sto_tsvector(json)
| s           | sto_tsvector(regconfig,jsonb) | s           | sto_tsvector(regconfig,json)  | s           | s 
(6 rows)

> Both of the _byid functions should be marked immutable, no?  Otherwise
> how can users use the new functions for indexing?

Yeah, if the (regconfig,text) one is considered immutable, I don't see
why the other two aren't.  The justification for the other three being
only stable is that they depend on default_text_search_config.

(You could argue that none of these should be immutable because text
search configurations are changeable, but we already decided to ignore
that for the (regconfig,text) case.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table