Re: Create user or role from inside a function? - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: Create user or role from inside a function?
Date
Msg-id 20060901112625.GJ5671@merkur.hilbert.loc
Whole thread Raw
In response to Create user or role from inside a function?  ("Dan" <ml@mutox.org>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Create user or role from inside a function?
Next
From: Andreas Kretschmer
Date:
Subject: Re: Create user or role from inside a function?