Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:34:54+00:00 2026-06-08T16:34:54+00:00

I have a postgresql (9.1.4) server running on a remote machine (Ubuntu 12.04), and

  • 0

I have a postgresql (9.1.4) server running on a remote machine (Ubuntu 12.04), and I’m having trouble accessing it on my local machine. Specifically, on my local machine, I can access the remote server using only the username “postgres” and the database name “postgres”, even though I have other user names and databases. First some of the background information. While in the interactive environment invoked with “psql” on the remote machine, I created another user, called “mxtxdb”, and set the password for that user. I also created a database called “mxtxdb”. To demonstrate their existence, I logged onto the remote machine and ran:

sudo su postgres
Password:
postgres@myhost:~$ psql                                  
psql (9.1.4)
Type "help" for help.

postgres=# \du
                             List of roles
 Role name |                   Attributes                   | Member of 
-----------+------------------------------------------------+-----------
 mxtxdb    |                                                | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 mxtxdb    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | mxtxdb=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(4 rows)

Furthermore, while still on the remote machine, I can access the database from the “mxtxdb” postgresql account:

postgres@myhost:~$ psql -h localhost -U mxtxdb -d mxtxdb
Password for user mxtxdb: 
psql (9.1.4)
Type "help" for help.

mxtxdb=>

But when I try to do the same on the local machine, I get this:

psql -h <server's address> -U postgres -d "postgres" -p 5432
Password for user postgres: 
psql (9.1.4)
Type "help" for help.

postgres=# 

and

psql -h <server's address> -U "postgres" -d "mxtxdb" -p 5432
Password for user postgres: 
psql: FATAL:  database "mxtxdb" does not exist

and

psql -h <server's address> -U "mxtxdb" -d "mxtxdb" -p 5432
Password for user mxtxdb: 
psql: FATAL:  role "mxtxdb" does not exist

The last two lines of my pg_hba.conf file are:

host    all             mxtxdb          0.0.0.0/0               trust
host    all             postgres        0.0.0.0/0               trust

and the listen_addresses is set to ‘*’ (and uncommented) in the postgresql.conf file.

Any idea why I cannot access other accounts or databases remotely, but I can when ssh’d into the remote machine?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:34:56+00:00Added an answer on June 8, 2026 at 4:34 pm

    First of all, thanks to Craig Richard for your suggestions, and in fact you were both correct. Here’s what happened: I installed PostgreSQL using sudo apt-get install postgresql-9.1, and then I followed the instructions for configuring the server at http://www.postgresql.org/docs/9.1/interactive/runtime.html . Unfortunately, what I did not notice was that the apt-get install process creates a postgresql database cluster by default, so when I followed the instructions to create a new one, I then had two clusters, one at /var/lib/postgresql/9.1/main and one at /usr/local/pgsql/data, and I was interacting with different clusters when I logged in locally vs remotely. When I removed the second cluster, the issue was resolved and I was able to connect remotely.

    My takeaways from this process: when installing postgresql with apt-get, and then following the instructions in the postgresql manual, be aware that the install process will create a postgres operating system user by default, and will also create a database cluster by default, so those steps in the manual do not need to be performed. If anyone experiences an error like:

    "FATAL: role/database '<name>' does not exist"
    

    when you are sure you’ve created that user or database, check to ensure that you’re operating with the correct database cluster.

    Thanks again!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a postgreSQL Server with some databases. Every user can only connect to
I have a Tomcat and PostgreSQL installed on a server. I'm having a connection
I have a PostgreSQL, php5, running on Apache2.0 (on a Windows machine.) I want
I have a weird problem. I can connect to a remote host using psql
I am using PostgreSQL 8.4 on Ubuntu. I have a table with columns c1
I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I'm using Windows
I have a Rails 2.0.2 application running with a postgresql db. The machine will
This is my first time using postgresql. I have checked and the server definitely
I have a server with PostgreSQL 8.4 which is being rebooted every night at
I have a postgresql database and am using it for a project which handles

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.