Skip to content

TsConfiguration integer values cause cache miss  #39

@jakob-lilliemarck

Description

@jakob-lilliemarck

While trying to insert a row using a struct with a TsConfiguration field, i run into the following error:

cache lookup failed for text search configuration 12832

The issue seems to be the integer value doesn't refer to any regconfig oid on my system. I used to following query to check which valid regconfig oid values exist:

SELECT oid, cfgname FROM pg_ts_config;

That returned:

3748	simple
13156	arabic
13158	armenian
13160	basque
13162	catalan
13164	danish
13166	dutch
13168	english
13170	finnish
13172	french
13174	german
13176	greek
13178	hindi
13180	hungarian
13182	indonesian
13184	irish
13186	italian
13188	lithuanian
13190	nepali
13192	norwegian
13194	portuguese
13196	romanian
13198	russian
13200	serbian
13202	spanish
13204	swedish
13206	tamil
13208	turkish
13210	yiddish

Using any of those integers directly in an INSERT like below works just fine, but if I use the integers defined on the TsConfiguration in this crate then I run into just the same issue as I get while running the query through rust & diesel.

INSERT INTO tag(name, description, lang, is_public)
VALUES ('test-lang', 'this is my english description', 13178, false);

I'm using postgres version:

psql (PostgreSQL) 15.3

I'm unsure if these oid values are expected to vary across different systems or if they can be expected to be the same, atleast with major versions, I'll try and look into it. If oid integers are not consistent or are expected to change often or , perhaps using a string value for inserting TsConfiguration would be more stable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions