简体   繁体   English

如何在PostgreSQL数据库表中插入其他字符?

[英]How to insert additional characters into a PostgreSQL Database Table?

I work with the programming language Java and I would to insert data with additional characters into a database table. 我使用Java编程语言,并且希望将带有其他字符的数据插入数据库表。

Here is an example: 这是一个例子:

INSERT INTO bv_usergroup (id, active, description, deleted) VALUES (1, TRUE, Administrator \(Company\), FALSE);

The additional character is the sign "(" and ")". 附加字符是符号“(”和“)”。 How can I solve this problem? 我怎么解决这个问题? And is it correct to insert boolean values how you can see it in my sql example? 插入布尔值是否正确,如何在我的sql示例中看到它?

Thenaks and Greetz Marwief 德纳克斯和格里兹·马尔维夫

Character literals (aka "strings") have to enclosed in single quotes: 字符文字(也称为“字符串”)必须用单引号引起来:

INSERT INTO bv_usergroup 
   (id, active, description, deleted) 
VALUES 
   (1, TRUE, 'Administrator (Company)', FALSE);

For more details on how to specifiy literals, please see the manual: 有关如何指定文字的更多详细信息,请参见手册:
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS

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

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