On Jul 19 10:02, Timothy Smith wrote: > cur.execute("""CREATE USER %s WITH PASSWORD %s IN GROUP %s > """,(StaffUserName,NewPassword,StaffGroup)) > > produces this error > > ERROR: syntax error at or near "'bob.smith'" at character 13
IIRC, per Python DB-API PEP, the DB adapter you use try to escape and quote any parameter you specified. Please try to use python parameters, that are "% (param1, param2, ...)", only for values; not for any other place in the query string. To summarize, you can only use parameters for values, not keys. Regards. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq