Thread: create user with database and contrib

create user with database and contrib

From
Michal Hlavac
Date:
hello,

is there some simple way, how to do this???

I need to create user 'diplo' with no database create and no add users
privileges...

createuser -A -D -P -E -U root diplo

after that I create database 'diplo';

I need to import ltree into database 'diplo' with user diplo, but I
can't add grant access to language 'c', because only superusers can do
that...

thanks, miso

Re: create user with database and contrib

From
Oleg Bartunov
Date:
On Sat, 9 Apr 2005, Michal Hlavac wrote:

> hello,
>
> is there some simple way, how to do this???
>
> I need to create user 'diplo' with no database create and no add users
> privileges...
>
> createuser -A -D -P -E -U root diplo
>
> after that I create database 'diplo';
>
> I need to import ltree into database 'diplo' with user diplo, but I
> can't add grant access to language 'c', because only superusers can do
> that...

so, what's the problem ?
psql diplo < ltree.sql


>
> thanks, miso
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Re: create user with database and contrib

From
Michal Hlavac
Date:
Oleg Bartunov wrote:
> so, what's the problem ? psql diplo < ltree.sql

ok, I can add ltree via superuser, but I must grant access for user
diplo to every function...

it is possible to do that easier?

Re: create user with database and contrib

From
Oleg Bartunov
Date:
On Sat, 9 Apr 2005, Michal Hlavac wrote:

> Oleg Bartunov wrote:
>> so, what's the problem ? psql diplo < ltree.sql
>
> ok, I can add ltree via superuser, but I must grant access for user
> diplo to every function...
>
> it is possible to do that easier?

Did you try what I recommend you ? It should works

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Re: create user with database and contrib

From
Bruno Wolff III
Date:
On Sat, Apr 09, 2005 at 15:19:58 +0200,
  Michal Hlavac <hlavki@medium13.sk> wrote:
> Oleg Bartunov wrote:
> > so, what's the problem ? psql diplo < ltree.sql
>
> ok, I can add ltree via superuser, but I must grant access for user
> diplo to every function...
>
> it is possible to do that easier?

Functions are created with a grant of EXECUTE to public by default.

Re: create user with database and contrib

From
Tom Lane
Date:
Oleg Bartunov <oleg@sai.msu.su> writes:
> On Sat, 9 Apr 2005, Michal Hlavac wrote:
>> ok, I can add ltree via superuser, but I must grant access for user
>> diplo to every function...

> Did you try what I recommend you ? It should works

Dunno about ltree, but I have found that the default installation of
tsearch2 is unusable by non-superusers because of lack of permissions.
I don't recall the details at the moment, but I think there are some
config tables that need to have permissions granted to PUBLIC.  It's
certainly not the functions, since those have PUBLIC EXECUTE by default.

If ltree has any components that aren't functions, it might need some
work of that kind too.

            regards, tom lane