Обсуждение: CREATE ROLE

Поиск
Список
Период
Сортировка

CREATE ROLE

От
Russell Denney
Дата:
OS X 10.4.8
postgres 8.1.5

I am about as novice as you can get, just installed postgres. Very
little experience with db's, but you gotta start somewhere.

Logged in as postgres, I created a role as Superuser. psql returned
CREATE ROLE.
When I enter \du it lists the new role, however, createdb and
createrole are listed as "no". I thought superusers bypassed all
permissions?

When I \q, psql returns "could not save history to file "/Users/
postgres/.psql_history": Invalid argument". Of what significance is
this at this point and how do I correct it?

When I log in to the OS as the new role name and attempt to start
psql it tells me the role does not exist. I tried this with and
without  the -U flag. Any clue as to what is going on?

I looked in the online manual, but was unable to find what I needed.
Does'nt mean it's not there, I just could'nt find it. If someone
would point me to documentation that explains it , I would appreciate
it.

BTW, anyone using OS X and postgres in the Tampa area? Being as green
as I am, I thought who better to write a tutorial, so future Mac
novices might find their way to using postgres. Having someone in my
area sure would be helpful.

Thanks for your help,

Russ

Re: CREATE ROLE

От
Richard Broersma Jr
Дата:
> Logged in as postgres, I created a role as Superuser. psql returned
> CREATE ROLE.
> When I enter \du it lists the new role, however, createdb and
> createrole are listed as "no". I thought superusers bypassed all
> permissions?

the real superuser user account is postgres.  If you want to create a role that will have more
than the default priveledges you must granted:
http://www.postgresql.org/docs/8.2/interactive/sql-grant.html

> When I \q, psql returns "could not save history to file "/Users/
> postgres/.psql_history": Invalid argument". Of what significance is
> this at this point and how do I correct it?

I expect that mean that your postgres unix user account doesn't have a home directory to save
these files.  At home directory is created by default on my system either.

I tried this with and
> without  the -U flag. Any clue as to what is going on?

if you do not specify an actual postgresql db account it tries to use your unix user account
instead.  If your unix user name doesn't exist in postgresql you get this error.
try "-U <one of you postgresql usernames>"

The following link should give 80% of everything you want to know.
http://www.postgresql.org/docs/8.2/interactive/tutorial.html

Regards,

Richard Broersma Jr.


Re: CREATE ROLE

От
nhrcommu@rochester.rr.com
Дата:
You may find a bit of Mac specific help here:

http://www.entropy.ch/software/macosx/postgresql/

Haven't been there in a bit, but there is a Mac specific forum that
seems reasonably active.

Mike Ellsworth

Re: CREATE ROLE

От
Tom Lane
Дата:
Russell Denney <r_denney@verizon.net> writes:
> Logged in as postgres, I created a role as Superuser. psql returned
> CREATE ROLE.
> When I enter \du it lists the new role, however, createdb and
> createrole are listed as "no". I thought superusers bypassed all
> permissions?

Those flags are stored independently, but the bottom line is that a
superuser has all permissions anyway.  In other words, if it says either
superuser or createdb, you can create a database, etc.

> When I \q, psql returns "could not save history to file "/Users/
> postgres/.psql_history": Invalid argument".

This is fixed in 8.2, but in 8.1 you can just ignore it --- it's a
Mac-specific discrepancy in what a library function returns :-(

            regards, tom lane