PostgreSQL-选择观察值并放入新表 [英] Postgresql - selecting observations and putting in new table
问题描述
对不起,是否已经被询问。我在以前的问题中看不到它。
Sorry if this has already been asked. I couldn't see it in previously asked questions.
我有一张桌子- eightks。
I have a table - 'eightks'.
此文件包含1,000,000个文本文档。
This file contains 1,000,000 text documents.
我只需要那些提及其他事件一词的人。因此,我尝试进行一些文本匹配,然后将这些文件输出到新表中。
I only need those that mention the word 'other events'. So I am trying to do some text matching and then output these files into a new table.
我当前的代码是;
SELECT * FROM eightks\d
WHERE to_tsvector(text) @@ to_tsquery('other_events');
运行此命令时出现以下错误
When I run this I get the following error
string is too long for tsvector (2368732 bytes, max 1048575 bytes)
还如何将匹配的行输出到新表中?
Also How do I output the matching rows into a new table?
我们将提供任何帮助。
推荐答案
这是记录的限制。
tsvector的长度(词素+位置)必须小于1兆字节
The length of a tsvector (lexemes + positions) must be less than 1 megabyte
可能可以更改源代码并重新编译。请参见 ts_type.h 。
It might be possible to change the source code and recompile. See ts_type.h. I suspect it won't be simple, though.
您可能需要将文档分解成较小的部分进行搜索,然后将这些部分组合以呈现给用户。
You might need to break the documents up into smaller pieces for searching, then combine the pieces for presentation to the user.
对于将行插入到另一个表中,您只需插入正确的select语句即可。基本上。 。
As for inserting the rows into another table, you can just insert a correct select statement. Basically . . .
insert into table_name
select ...
您可能需要提供列名。
这篇关于PostgreSQL-选择观察值并放入新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!