postgresql - 在触发器后插入一行:错误:文本搜索配置名称" myparser"必须是模式限定的吗?

时间:2017-11-01 03:37:53

标签: postgresql

我在mytable上创建了一个触发器:

CREATE TRIGGER mytable_trigger 
    BEFORE INSERT OR UPDATE ON mytable 
    FOR EACH ROW 
    EXECUTE PROCEDURE tsvector_update_trigger(tsv, 'myparser', title);

但是当我插入一行时

insert into mytable (title) values ('great bulding')

有一个错误:

  

错误:文本搜索配置名称" myparser"必须是模式限定的;

下面是文本搜索配置列表:

           List of text search configurations
   Schema   |    Name    |              Description
------------+------------+---------------------------------------
...
pg_catalog | turkish    | configuration for turkish language
pg_catalog | myparser   |
public     | fulltest   |
(18 rows)

1 个答案:

答案 0 :(得分:1)

现在我知道,在创建触发器时,我必须使用schema指向.测试搜索配置。 所以我应该使用

CREATE TRIGGER mytable_trigger BEFORE INSERT OR UPDATE ON mytable FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(tsv, 'pg_catalog.myparser', title);

public.fulltestpg_catalog.turkish;