Обсуждение: Re: How to list and remove a user in postgres ?
Fred wrote: > > Hi, > > I am a newby and i dont understand how to list al the users or delete them ? > > 1 do i it from the command line in Linux > 2 or in the database > > i have a user Fred and a user Grades and want delete them. > Go onto psql and type \h. This will bring up topics that you can access by typing the backslash and the topic name (\h createuser.) I don't recall a method for listing all users. -- Homer J. Welch hjwxxx@home.com Troy, Michigan
On Wed, Jul 12, 2000 at 07:45:50PM +0000, HomerWelch wrote:
> Fred wrote:
> >
> > Hi,
> >
> > I am a newby and i dont understand how to list al the users or delete them ?
> >
> > 1 do i it from the command line in Linux
> > 2 or in the database
> >
> > i have a user Fred and a user Grades and want delete them.
> >
>
> Go onto psql and type \h. This will bring up topics that
> you can access by typing the backslash and the topic name
> (\h createuser.) I don't recall a method for listing all
> users.
select * from pg_user;
reedstrm=>\h drop user
Command: drop user
Description: remove a user from the system
Syntax:
DROP USER user_name;
HTH,
Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
HomerWelch <hjwxxx@home.com> writes: > Fred wrote: > > > > Hi, > > > > I am a newby and i dont understand how to list al the users or delete them ? > > > > 1 do i it from the command line in Linux > > 2 or in the database > > > > i have a user Fred and a user Grades and want delete them. > > > > Go onto psql and type \h. This will bring up topics that > you can access by typing the backslash and the topic name > (\h createuser.) I don't recall a method for listing all > users. > > -- > > Homer J. Welch hjwxxx@home.com > Troy, Michigan drop user username; select usename from pg_user; -- Prasanth Kumar kumar1@home.com
HomerWelch <hjwxxx@home.com> wrote:
> (\h createuser.) I don't recall a method for listing all
> users.
man psql
has a lot of good information.
Log in as postgres (or whoever is your postgres super user), then run
psql, and:
\dS
Will give you a list of the system tables (relations).
\dS pg_user
Will give you the structure of that table, and actually some more help.
SELECT usename, usesuper from pg_shadow;
Will give you a list of the users that are define, and indicate which one
is the super user.
Yves.
----
Yves Dorfsman dorfsmay@cuug.ab.ca
http://www.cuug.ab.ca/~dorfsmay