On Fri, Sep 01, 2006 at 08:13:14PM +1000, Dan wrote:
> I am running PostgreSQL 8.1.4 and I want to create a user from inside a
> function. Is this possible in 8.1?
...
> I have a function like this:
...
> Executing this function yields:
>
> # SELECT user_create('bob',1234,'bobspassword');
> ERROR: column "CREATE USER " does not exist
> CONTEXT: SQL statement "SELECT "CREATE USER " || $1 || " WITH PASSWORD
> " || $2 "
> PL/pgSQL function "user_create" line 2 at execute statement
...
> Any tips would be appreciated.
http://cvs.savannah.gnu.org/viewcvs/gnumed/gnumed/server/sql/gmCreateUserFunction.sql?rev=1.5&root=gnumed&view=markup
This might help.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346