[HACKERS] jsonb_to_tsvector should be immutable

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема [HACKERS] jsonb_to_tsvector should be immutable
Дата
Msg-id ec5775ba-a1bf-ad2c-8d05-5ffce1f0cd19@berkus.org
обсуждение исходный текст
Ответы Re: [HACKERS] jsonb_to_tsvector should be immutable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Wanted to pull this out of my general report, because nobody seems to
have seen it:

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

... and indeed it's not:

select proname, prosrc, proargtypes, provolatile from pg_proc where
proname = 'to_tsvector';  proname   |         prosrc         | proargtypes | provolatile
-------------+------------------------+-------------+-------------to_tsvector | jsonb_to_tsvector      | 3802        |
sto_tsvector| to_tsvector_byid       | 3734 25     | ito_tsvector | to_tsvector            | 25          | sto_tsvector
|json_to_tsvector       | 114         | sto_tsvector | jsonb_to_tsvector_byid | 3734 3802   | sto_tsvector |
json_to_tsvector_byid | 3734 114    | s
 

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



-- 
Josh Berkus
Containers & Databases Oh My!



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table