简体   繁体   English

postgres和h2 db中名称中的#个字符出现问题

[英]problem with # character in name in postgres and h2 db

I have a set of book names which I am adding to a Books table. 我有一组要添加到Books表中的书名。 The names are all copied from amazon website 名称均从亚马逊网站复制

1.The Winter King (The Arthur Books #1)
2.Enemy of God (The Arthur Books #2)

when I add these to the table ,and later try a query using the exact name,I get no results.I tried postgres and h2 databases. 当我将它们添加到表中,然后尝试使用确切名称进行查询时,没有任何结果。我尝试了postgres和h2数据库。

Finally,when I listed the items using 最后,当我使用

>>select b.name from Books b;

The Winter King (The Arthur Books
Enemy of God (The Arthur Books

It seems that the # character is omitted..So,how do I get around this?Do I have to modify all my data by removing the # character from the entries? 似乎省略了#字符。因此,如何解决此问题?是否必须通过从条目中删除#字符来修改我的所有数据? or is there a workaround? 还是有解决方法?

When using CSV import ( CSVREAD ) in an older version of H2, then the # character is parsed as a line comment. 在旧版本的H2中使用CSV导入( CSVREAD )时, #字符将被解析为行注释。 This is no longer the case by default for H2 version 1.3.150 and newer, as described in the change log . 默认情况下,H2版本1.3.150和更高版本不再是这种情况,如更改日志中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM