TO make a database backup in postgreslq server you use pg_dump and psql commands.
First, locate the database:
# psql -l --username postgres --password
Then:
# pg_dump --username postgres name_db --file /dir/dir/backup.sql
To restore the database:
First create database with its respective name and roles:
# psql postgres
# postgres=# CREATE DATABASE name_db ENCODING 'UTF-8';
# postgres=# CREATE ROLE
I installed postgresql via homebrew on my 10.7.3. The install seemed successful and I was able to start up the server. However when I try to access psql I get the following error:
psql: FATAL: role "larson" does not exist
In this case larson is my username. Does anybody know what the issue is and what I can do to address it?
I'm trying to run a postgis sql script and I'm running into the following error.
Am I correct to say that updating my server version will fix it? If so, how can I go about updating it?
I'm on Mac OSX Lion and installed Postgres via brew. Apparently I have an older version installed which is 9.1.2 but installing postgis installed postgres 9.2.1 on to my system.
I have installed postgresql via apt-get install postgresql, but have an error, don't make the folder /etc/postgresql/9.1.
The error on psql:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
i have installed the postgre via apt-get install postgresql, but have a error, dont make the folder /etc/postgresql/9.1
the error on 'psql':
psql: could not connect to server: No such file or directory Is the
server running locally and accepting connections on Unix domain
socket "/var/run/postgresql/.s.PGSQL.5432"?
I'm using ubuntu 12.01 and postgres 9.15.
I've installed postgres, but I can't access it for anything. Every
When I try to create a db, I get this:
Code:
createdb: could not connect to database postgres: FATAL: role "root" does not exist
I googled for postgres "roles". I found syntax for creating roles.
In /var/lib/pgsql/9.1/data/pg_hba.conf, I have the following:
# TYPE DATABASE USER ADDRESS METHOD
host all all 127.0.0.1/32 trust
But when I execute this:
su -c "psql -d postgres" - postgres
it asks me for a password. My expectation is that users shoud not be prompted for a password.
I have a postgres 8.4 install on ubuntu 10.04.
I created a cluster on a disk that is not mountable anymore.
Edit: see comment for answer.
I have an interesting question.
On my OS X 10.8 server postgres is running fine.
Launchd has is loaded under the label 'org.postgresql.postgres' and '# launchctl list org.postgresql.postgres' gives the output I expected.
The problem is: I cant find the configuration file.
In /S/L/LaunchDeamons and in /L/LaunchDeamons I only have an 'org.postgresql.postgres_alt.plis