postgresql dollar引号在其中
对于在PostgreSQL中的Where子句中尝试或需要解决方案的人来说,应如何使用。
文档可能很难理解,没有适当的例子,所以这里是我的
:如果您想提出一个请求,因为
SELECT
*
FROM
<TableName>
WHERE
<ColumnName> = 'string with ' character';
它会抛出错误原因,原因是“字符'”在字符串之外
For people who tried or needed a solution to escape every special character (even $) in a WHERE CLAUSE in POSTGRESQL, here is how it should be use
the documentation can be somehow hard to understand, and there is no proper example of it so here is mine
e.g : if you want to make a request looking as
SELECT
*
FROM
<TableName>
WHERE
<ColumnName> = 'string with ' character';
it will throw an error cause "character'" is outside the string
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,这是应该写的:
条件
从字面上占用字符串;该界面看起来可能打破,但仍将按照预期解释以下指令。这甚至可能是
$$
的另一个逃脱字符串。有关美元报价的详细信息,请查看文档。
So here is how it should be written:
The
WHERE CONDITION
will take the string literally; the interface may look broken but the following instruction will still be interpreted as expected.This could even be another escaped string with
$$
.For details about dollar quoting, look at the documentation.