pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable
3+ messages / 3 participants
[nested] [flat]

* BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable
@ 2017-07-16 18:10 007reader@gmail.com
  2017-07-16 18:29 ` Re: BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable Tom Lane <tgl@sss.pgh.pa.us>
  2017-07-16 18:31 ` Re: BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable Jeff Janes <jeff.janes@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: 007reader@gmail.com @ 2017-07-16 18:10 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: 007reader@gmail.com

The following bug has been logged on the website:

Bug reference:      14745
Logged by:          Bob Jones
Email address:      007reader@gmail.com
PostgreSQL version: 10beta2
Operating system:   Debian in Docker container
Description:        

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



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable
  2017-07-16 18:10 BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable 007reader@gmail.com
@ 2017-07-16 18:29 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-07-16 18:29 UTC (permalink / raw)
  To: 007reader@gmail.com; +Cc: pgsql-bugs

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=# create index j_ixd on test using gin(to_tsvector('english', j));
CREATE INDEX
regression=# 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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable
  2017-07-16 18:10 BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable 007reader@gmail.com
@ 2017-07-16 18:31 ` Jeff Janes <jeff.janes@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff Janes @ 2017-07-16 18:31 UTC (permalink / raw)
  To: 007reader@gmail.com; +Cc: pgsql-bugs

On Sun, Jul 16, 2017 at 11:10 AM, <007reader@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14745
> Logged by:          Bob Jones
> Email address:      007reader@gmail.com
> PostgreSQL version: 10beta2
> Operating system:   Debian in Docker container
> Description:
>
> 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
>

to_tsvector(regconfig, json[b])  and to_tsvector(json[b]) are not the same
thing.

Only the first is immutable, you are using the second.

Cheers,

Jeff

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-07-16 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-07-16 18:10 BUG #14745: to_tsvector(regconfig, json[b]) is NOT immutable 007reader@gmail.com
2017-07-16 18:29 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-07-16 18:31 ` Jeff Janes <jeff.janes@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox