QPSQL + QSqlQuery 准备失败

发布于 2024-12-25 18:00:11 字数 260 浏览 1 评论 0原文

再次大家好:)我目睹了一种奇怪的行为。

当我这样做时,

if (!physical_query.prepare("CREATE USER sensei")) { ... }

它无法自行准备。但是当查询是 SELECT 时(例如),一切正常。 我构建的QPSQL驱动程序是针对Postgre 9.0.6的,现在安装的数据库也是9.0.6。但较新的版本。也许不同的dll有问题?或者我应该重建驱动程序?

谢谢。

Hello again :) I'm witnessing a strange behaviour.

When I do this

if (!physical_query.prepare("CREATE USER sensei")) { ... }

The it cannot prepare itself. But when the query is SELECT (for example) everything is ok.
The QPSQL driver I built was for Postgre 9.0.6, and now the installed db is also 9.0.6. but a newer version. Maybe different dlls are the problem? Or should I rebuild the driver?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春花秋月 2025-01-01 18:00:11

即使在 SQL 级别,也无法准备诸如“CREATE USER”之类的 DDL 语句:

steve@steve@[local] =# prepare t as create user xyzzy;
ERROR:  syntax error at or near "create"
LINE 1: prepare t as create user xyzzy;
                     ^

DDL statements such as "CREATE USER" can't be prepared, even at the SQL level:

steve@steve@[local] =# prepare t as create user xyzzy;
ERROR:  syntax error at or near "create"
LINE 1: prepare t as create user xyzzy;
                     ^
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文