sql – pgAdmin III错误举动?
我正在对pgAdmin举办查询,偶尔发明白这种稀疏的举动.
ghareh@godot:~$psql psql (9.1.9) Type "help" for help. ghareh=# d messages Table "public.messages" Column | Type | Modifiers ---------------+-----------------------------+--------------------------------- messageid | character varying(200) | not null senderaliasid | integer | not null referenceid | character varying(200) | default NULL::character varying recipaliasid | integer | datetime | timestamp(2) with time zone | not null subject | character varying(512) | not null body | text | not null listid | integer | Indexes: "messages_pkey" PRIMARY KEY,btree (messageid) "messages_datetime_idx" btree (datetime) "recipaliasid_idx" btree (recipaliasid) "referenceid_idx" btree (referenceid) "senderaliasid_idx" btree (senderaliasid) Foreign-key constraints: "messages_listid_fkey" FOREIGN KEY (listid) REFERENCES lists(listid) "messages_recip_fkey" FOREIGN KEY (recipaliasid,listid) REFERENCES aliases(aliasid,listid) "messages_sender_fkey" FOREIGN KEY (senderaliasid,listid) Referenced by: TABLE "messages_attachments" CONSTRAINT "pkfkmid" FOREIGN KEY (messageid) REFERENCES messages(messageid) 我的题目涉及专栏,正文和主题. 我有一个天生一组功效的查询.然后,为了优化我的查询,我添加了一个术语:where body就像’%JSON%’,即body的布局子集,个中body包括字符串’JSON’. 这是我的起源查询: select * from messages where messageid = '44BC310F.1090305@torrez.us' 返回1行: messageid: "44BC310F.1090305@torrez.us"; senderaliasid: 13777; referenceid: "7edfeeef0607171746r7d708067g15c77c3aa0ef9158@mail.gmail.com"; recipaliasid: ; datetime: "2006-07-17 20:53:35-07"; listid: 251; subject: "Re: svn commit: r422930 - /incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java"; body: "busted! thanks for the thorough review. -Elias Garrett Rooney wrote: > On 7/17/06,eliast@apache.org <eliast@apache.org> wrote: >> Author: eliast >> Date: Mon Jul 17 17:44:10 2006 >> New Revision: 422930 >> >> URL: http://svn.apache.org/viewvc?rev=422930 (...)" 假如我搜刮: select * from messages where messageid = '44BC310F.1090305@torrez.us' and body like '%JSON%' 我不该该获得任何功效,由于身材里没有.但我如故获得沟通的行返回 – 这好像是由于’JSON’在主题中? 我乃至试过这个: select * from messages where messageid = '44BC310F.1090305@torrez.us' and body like '%incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java%' 并且我尚有同样的一排.我很是狐疑. 我试图在sqlfiddle.com上重现功效,但我没有乐成.在哪里,我获得了sql select查询的预期: 办理要领您无法在SQL Fiddle上重现沟通的结果.我在Postgres 9.1.13(always upgrade to the latest point release!)中从头建设了表,并在pgAdmin(当前版本1.18.1)中运行了查询.我无法重现这个题目. pgAdmin的? 我没有看到pgAdmin如安在这方面施展浸染 – 除非你只选择了一部门查询,不然不知道这种结果: 可能您也许会被“每列最多字符数”配置所诱骗,该配置会截断表现中的长值,将匹配潜匿在截断的部门中,如@IMSoP suggested in his comment.搜查文件 – >选项…… 假如不是这样,除非我们处理赏罚你的题目中没有的拼写错误或环境,不然这表白你的数据库中存在某些题目. 糜烂? 在只有一个破坏的索引的简朴环境下, REINDEX TABLE messages; 可是,细心看,我没有看到一个索引也许是这里的祸首罪魁. 体系目次破坏?起首阅读: 然后阅读Notes section for $export PGOPTIONS="-P" $psql broken_db ... broken_db=> REINDEX DATABASE broken_db; broken_db=> q 糜烂凡是表白您的硬件存在题目.失败的磁盘或其他对象.跟进…… 相干题目: (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |