Hello Tom

You need to use EXECUTE to construct this query as a string.
Utility statements in general don't handle parameters.


Ok. I tried out:

PREPARE create_user(varchar) AS SELECT $1;
ok
EXECUTE create_user('otto');
ok
DEALLOCATE create_user;
ok
PREPARE create_user(varchar) AS CREATE USER $1;
ERROR:  syntax error at or near "CREATE" at character 33

--> Then I was looking into the manual and found that PREPARE/EXECUTE only works with SIUD :-(

Facit: pgplsql does not work for my problem, execute does not work problem.

Is there any other way to enable a user to create other users than granting superuser rights?
In my opinion it is a little much privileges to just create new users.

Proposal for a next release: CREATE USER system privilege. Where do I have to request for such a proposal?

Regards Oli

-------------------------------------------------------

Oli Sennhauser
Database-Engineer (Oracle & PostgreSQL)
Rebenweg 6
CH - 8610 Uster / Switzerland

Phone (+41) 1 940 24 82 or Mobile (+41) 79 450 49 14
e-Mail [EMAIL PROTECTED]
Website http://mypage.bluewin.ch/shinguz/PostgreSQL/

Secure (signed/encrypted) e-Mail with a Free Personal SwissSign ID: http://www.swisssign.ch

Import the SwissSign Root Certificate: http://swisssign.net/cgi-bin/trust/import


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to