8

I am on Unix. I have got postgresql-9.3 installed.
When I want to start the server using pg_ctl or postgres, the terminal gives me:

The program 'postgres' is currently not installed. You can install it by typing:
sudo apt-get install postgres-xc

Can't I start the server without this postgres-xc?

2
  • the server can also be started using /etc/init.d/postgresql start Commented Jul 15, 2014 at 12:10
  • What kind of "Unix" are you using? Commented Jul 15, 2014 at 12:10

4 Answers 4

4

This must be remnants of the postgres-xc package you had installed previously.

Since you just installed postgresql-9.3 and don't seem to have any databases in use, yet, I suggest to completely purge all postgres packages.

sudo apt-get purge postgresql-9.2
sudo apt-get purge postgresql-xc
...

Until there's nothing left:

dpkg -l | grep postgres

Then start from scratch. Your instance of pg_ctl seems to belong to the package postgres-xc. This should be gone after you've uninstalled the package. Find out with one of these commands:

dpkg -S pg_ctl
dlocate pg_ctl
apt-file search pg_ctl

pg_ctlcluster is provided by the package postgresql-common.
pg_ctl is provided by the package postgresql-9.3.

More about starting Postgres in the manual.

Sign up to request clarification or add additional context in comments.

1 Comment

on a rather confused Server your command dpkg -l | grep postgres helps plenty to see what Ubuntu thinks it has installed. +1
2

Due to reasons a normal install of postgres will not place the postgres binary file in the path.

Adding the right directory to the path solves the problem (temporarily).

PATH=/usr/lib/postgresql/9.3/bin:$PATH

To make it permanent on my Ubuntu machine I added the line to /etc/environment this makes it work for all users.

The correct way to set the PATH is different for different systems, for more info see see:

How to permanently set $PATH on Linux?

Comments

0

It is possible you might be missing a few things.

Try: sudo apt-get install postgresql-client and sudo apt-get install postgresql postgresql-contrib

The message about installing xc is a dud, it's probably suggesting that based on what it scanned inside the xc repositories.

Here's a good reference to this problem and its solution: https://dba.stackexchange.com/questions/72580/missing-the-pg-ctl-package-in-postgres-9-3-installation

Comments

0

You must install postgresql-client:

sudo install postgresql-client

Try to enter this command to the console:

sudo -u postgres psql

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.