User login

Using PostgreSQL (psql) - getting past the immediate authentication failure

How in the world aren't there very clear instructions for getting started with PostgreSQL after apt-get install postgresql?

UPDATE: Doing this the right way

Read the documentation that Debian (and so Ubuntu) provide, typically in /usr/share/doc/<package-name>

The documentation we need can be read with:
vi /usr/share/doc/postgresql-8.4/README.Debian.gz

2. Get a shell for the database superuser 'postgres'. If your system
has an active root user, use su:

$ su -c "su -s /bin/sh postgres"

If your system uses sudo to get administrative rights, use sudo instead:

joe$ sudo -u postgres sh

3. In this postgres shell, create a database user with the same name as your
Unix login:

$ createuser -DRS joe

Old flailing around left for posterity

sudo vi /etc/postgresql/8.4/main/pg_hba.conf

change these two lines to:

# Database administrative login by UNIX sockets
local   all         all                          trust


# "local" is for Unix domain socket connections only
local   all         all                               trust


sudo /etc/init.d/postgresql restart

Searched words: 
postgresql initial password, psql first account, psql: FATAL: Ident authentication failed for user


Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.