On Friday 11 May 2001 16:17, Hannu Krosing wrote:
John Morton wrote:
I'm attempting to use a ZSQL method to create a new user in a postgresql database (in the CREATE USER... sense), using Popy and postgres 7.0. The problem is that CREATE USER throws an error if you use it inside an explicit transaction.
I see no problem here:
hannu=# begin; BEGIN hannu=# create user hu; CREATE USER hannu=# commit; COMMIT hannu=#
I'm using postgres 7.0.3, snarfed from woody and built for potato, and I did test it with the psql console. I suspect that the behaviour has changed between 6.4 and 7 as create user supports group settings - necessitating insert/updates to two tables, and therefore wraping the lot in a transaction to keep create user an atomic statement. Guess you can't nest transactions :-) I think I'll update pg_user by hand for the time being, to get around the problem. John