Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to login as a postgresql user ?

How to login as a postgresql user ?

How to login as a postgresql user ?

Initdb -> worked ok
postmaster -> starts with no error messages

When trying to create a database with createdb, the following message is displayed :
psql: FATAL 1: user "bioforme" does not exist

After reading some documentation, it seems that I have to be loged in as a prostgres user.
How is this to be done ?
(I tried to leave KDE and login with "prostgres" as username and "prostgres" as password but it did not work, I also tried to put my user name in the postgres user groupe with no result)

This is probably very basic, but not easy to find.

Thanks in advance for any help.

Note : OS is mandrake 8.1

RE: How to login as a postgresql user ?

Well, I'm sure this is just a small mistake on your part, but "prostgres" is not the default username. It is "postgres".

In a default install of PostgreSQL, the "owner" of postgreSQL is usually the user called postgres. However, this is not necessarily the case, so I would have to see exactly how Mandrake handles it.

Try running "top" or "ps -ax" from a terminal window, and see if it shows "postgres" as the owner of the postgres process. The line in question should look something like
  280 postgres        2   0  5348K   856K select   0:16  0.00%  0.00% postgres

(From top), or:

  280 con- I      0:16.01 /usr/local/bin/postmaster -D /usr/local/pgsql/data -i (postgres)

(From ps -ax)

However, if you didn't already have a user called "postgres" on your machine, then what user is the postgres process (from postmaster) running under? The basic idea here is that the postgres process runs under a certain username (not root), and points to s certain data directory with the keyword "-D /directory/path". The username running the process is the user that can log into postgreSQL and control it completely. Inside postgreSQL, that user can create many sub-users who con connect to this or that database. All postgreSQL users must be valid users on the Linux system in general.


"Now, this might cause some discomfort..."

RE: How to login as a postgresql user ?

Thanks for your help.

So far it has been possible to login as "su - postgres".
Database could be created and pgaccess is runnig fine.
Creating new users was also possble.

"ps -ax" has allowed me to see that the default data directory is /var/lib/pgsql/data in mandrake 8.1.

Importing data from a text file did not work:
<copy "database" from "database.txt" delimters ";">
returned no errors but database remains empty.
Strange . . .

Detlef Hossbach
(occasional programmer)

RE: How to login as a postgresql user ?

PostgreSQL database users don't have to be users in the Linux system itself.  They're separate.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close