create user with database and contrib

Started by Michal Hlavacabout 21 years ago6 messagesgeneral
Jump to latest
#1Michal Hlavac
hlavki@medium13.sk

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

#2Oleg Bartunov
oleg@sai.msu.su
In reply to: Michal Hlavac (#1)
Re: create user with database and contrib

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

#3Michal Hlavac
hlavki@medium13.sk
In reply to: Oleg Bartunov (#2)
Re: create user with database and contrib

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?

#4Oleg Bartunov
oleg@sai.msu.su
In reply to: Michal Hlavac (#3)
Re: create user with database and contrib

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

#5Bruno Wolff III
bruno@wolff.to
In reply to: Michal Hlavac (#3)
Re: create user with database and contrib

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.

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Oleg Bartunov (#4)
Re: create user with database and contrib

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