Search Postgresql Archives

How to change the default database for a user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've created a user and a database both wrongly named "phpbb".
After that I have renamed both to "punbb" using "ALTER DATABASE"
and "ALTER USER". Now everything works fine, except I always
have to specify the database when connecting (both using psql or
the PQconnectdb() from my C-program):

    h754814:afarber {103} psql -U punbb
    psql: FATAL:  database "phpbb" does not exist

    h754814:afarber {104} psql -U punbb punbb
    Welcome to psql 8.1.0, the PostgreSQL interactive terminal.
    ....
    punbb-> \l
              List of databases
       Name    |    Owner    | Encoding
    -----------+-------------+-----------
     postgres  | _postgresql | SQL_ASCII
     punbb     | _postgresql | SQL_ASCII
     template0 | _postgresql | SQL_ASCII
     template1 | _postgresql | SQL_ASCII
    (4 rows)

    punbb-> \du
                                    List of roles
      Role name  | Superuser | Create role | Create DB | Connections |
Member of
    -------------+-----------+-------------+-----------+-------------+-----------
     _postgresql | yes       | yes         | yes       | no limit    |
     punbb       | no        | no          | no        | no limit    |
    (2 rows)

    punbb-> select * from pg_user;
       usename   | usesysid | usecreatedb | usesuper | usecatupd | 
passwd  | valuntil | useconfig
    -------------+----------+-------------+----------+-----------+----------+----------+-----------
     _postgresql |       10 | t           | t        | t         |
******** |          |
     punbb       |    16384 | f           | f        | f         |
******** |          |
    (2 rows)

How do I please set the database "punbb" to be the default
database for the user called "punbb"?

Regards
Alex


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux