Re: CREATE USER system privilege?

Поиск
Список
Период
Сортировка
Искать
От
Oli Sennhauser
Тема
Re: CREATE USER system privilege?
Дата
Msg-id
404B5018.1020805@bluewin.ch
Ответ на
Список
Дерево обсуждения
CREATE USER system privilege? Oli Sennhauser <oli.sennhauser@bluewin.ch>
Re: CREATE USER system privilege? Tom Lane <tgl@sss.pgh.pa.us>
Re: CREATE USER system privilege? Oli Sennhauser <oli.sennhauser@bluewin.ch>
Re: CREATE USER system privilege? Tom Lane <tgl@sss.pgh.pa.us>
Re: CREATE USER system privilege? Oli Sennhauser <oli.sennhauser@bluewin.ch>
Hi admins

Long ago I was asking about system privilege "create user" and 
procedures to create users without superuser rights.
Now I have finished some pgplsql-Procedures for granting this rights to 
a normal operator.

You can find them on 
http://mypage.bluewin.ch/shinguz/PostgreSQL/skripts/f_create_user.tar.gz

Regards Oli


Tom Lane wrote:

>Oli Sennhauser  writes:
>  
>
>>>You need to use EXECUTE to construct this query as a string.
>>>      
>>>
>
>  
>
>>Facit: pgplsql does not work for my problem, execute does not work problem.
>>    
>>
>
>I didn't think I would have to spell it out in gory detail ...
>
>regression=# create or replace function cruser(text) returns void as '
>regression'# begin
>regression'#   execute ''CREATE USER '' || quote_ident($1);
>regression'#   return;
>regression'# end' language plpgsql;
>CREATE FUNCTION
>regression=# select cruser('foo');
> cruser
>--------
>
>(1 row)
>
>regression=# select cruser('bar');
> cruser
>--------
>
>(1 row)
>
>regression=# select usename from pg_user;
>        usename
>-----------------------
> postgres
> pleb
> foo
> bar
>(5 rows)
>
>regression=#
>
>			regards, tom lane
>
>  
>


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

Haben Sie Ihre Firma schon im FOSS-Directory (www.foss-directory.ch) eingetragen?

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

Phone (+41) 1 940 24 82
e-Mail oli.sennhauser@bluewin.ch
Website http://mypage.bluewin.ch/shinguz/PostgreSQL/

В списке pgsql-admin по дате отправления
От: Andrew Sullivan
Дата:
Сообщение: Re: ERServer on Windows?
От: Stephan Szabo
Дата:
FAQ