Skip site navigation (1) Skip section navigation (2)

Fatal: Database does not exist

From: "Suvanaket, Dear (MS)" <Dear(dot)Suvanaket(at)ngc(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Fatal: Database does not exist
Date: 2009-02-27 21:41:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I get the error "FATAL: Database "xxx" does not exist" when trying to connect to the database using JDBC. The superuser "postgres" owns my database and tables. However, it seems I can only connect to the database when the username matches the name of the database I am connecting to. I can't connect to the database as the superuser postgres who owns the database. For example, if my database were named "Trudy", I can only connect with a user named "Trudy".
The Java code I'm using to connect looks something like this:
         //Register the JDBC driver for PostgreSQL.
         //Get a connection to the database
         Connection conn = DriverManager.getConnection(url, username, password);
         PreparedStatement ps = 
      catch(Exception e){
Is there anyway to fix the access so I can use a superuser other than the one named after the database?


pgsql-admin by date

Next:From: Scott MarloweDate: 2009-02-27 22:42:58
Subject: Re: Fatal: Database does not exist
Previous:From: Tom LaneDate: 2009-02-27 18:42:43
Subject: Re: Wanting to run Postgres 8.3.6 on BSD/OS 4.3.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group