不能在 psycopg2 中使用 ` 吗?
Is it not possible to use `in psycopg2?
我想使用psycopg2上传数据到postgresql。
使用我使用的其他扩展的命令如下。
\set content `cat file path`
INSERT INTO tablename (column) VALUES (:'content');
此外,在psycopg2中,\set不可用,所以我将其更改为SET。
然而,psycopg2 还有一个问题。
`(反引号)无法识别。
错误显示为
psycopg2.errors.SyntaxError: syntax error at or near "`".
还有其他方法可以使用吗?
你不会那样做,因为所有这些命令和功能都是特定于命令行客户端的 psql
。
我想使用psycopg2上传数据到postgresql。
使用我使用的其他扩展的命令如下。
\set content `cat file path`
INSERT INTO tablename (column) VALUES (:'content');
此外,在psycopg2中,\set不可用,所以我将其更改为SET。
然而,psycopg2 还有一个问题。
`(反引号)无法识别。
错误显示为
psycopg2.errors.SyntaxError: syntax error at or near "`".
还有其他方法可以使用吗?
你不会那样做,因为所有这些命令和功能都是特定于命令行客户端的 psql
。