Itzuke
Itzuke

Reputation: 43

QPSQL + QSqlQuery failed to prepare

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.

Upvotes: 0

Views: 608

Answers (1)

araqnid
araqnid

Reputation: 133492

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;
                     ^

Upvotes: 2

Related Questions