1

我在 Fedora 27 64 位上运行 PostgreSQL 9.6.8。当我执行此查询时:

UPDATE tbl SET textsearchable_index_col = 
setweight(to_tsvector('french', coalesce("col1",'')), 'D') || 
setweight(to_tsvector('french', coalesce("col2",'')), 'D');

我收到此错误:

ERROR:  cache lookup failed for function 3625

********** Error **********

ERROR: cache lookup failed for function 3625
SQL state: XX000

但是当我执行时:

UPDATE tbl SET textsearchable_index_col = 
setweight(to_tsvector('french', coalesce("col1",'')), 'D');

或者

UPDATE tbl SET textsearchable_index_col = 
setweight(to_tsvector('french', coalesce("col2",'')), 'D');

我得到:

Query returned successfully: 0 rows affected, 11 msec execution time.

我的问题是为什么它单独适用于任一列但在一起时不起作用?此链接显示应该可以在同一查询中使用两列(在第 12.3.1 节的末尾)。

编辑:这是系统为 Laurenz 的查询返回的内容。第一个查询返回

 oprname | oprleft  | oprright | oprcode     
---------+----------+----------+----------
 ||      | tsvector | tsvector | 3625

第二个查询返回一个空结果集。

4

1 回答 1

1

您的数据库已损坏,并且您缺少操作员tsvector_concat背后的功能||

这是它在健康系统上的外观:

SELECT oprname, oprleft::regtype, oprright::regtype, oprcode
FROM pg_operator
WHERE oid = 3633;

 oprname | oprleft  | oprright |     oprcode     
---------+----------+----------+-----------------
 ||      | tsvector | tsvector | tsvector_concat
(1 row)

SELECT proname, proargtypes::regtype[], prosrc
FROM pg_proc
WHERE oid = 3625;

     proname     |        proargtypes        |     prosrc      
-----------------+---------------------------+-----------------
 tsvector_concat | [0:1]={tsvector,tsvector} | tsvector_concat
(1 row)

您的情况缺少第二部分。

您应该从备份中恢复。

试着弄清楚你是如何陷入这种混乱的,这样你将来就可以避免它。

于 2018-04-14T18:58:16.187 回答