Postgresql 在psycopg2中不能使用`吗?

Postgresql 在psycopg2中不能使用`吗?,postgresql,psycopg2,Postgresql,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 &q

我想使用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

其他命令没有问题,只是因为反勾?或者不可能设置变量?SQL中没有变量<代码>设置更改数据库参数。使用Python变量和准备好的语句。