Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed CentOS on a virtual machine and installed the latest version of PostgreSQL server 9.3. I have added PostGIS extension and some data.

For some reason, the PostgreSQL service now fails to start.

How can I get the table structure (with sequences, indexes, and relations) and data, and move it to another server?


migration rejected from Mar 3 '15 at 0:49

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by dezso, RolandoMySQLDBA, RLF, Paul White, Michael Green Mar 3 '15 at 0:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – dezso, RolandoMySQLDBA, RLF
If this question can be reworded to fit the rules in the help center, please edit the question.

@Anatoly: why don't you try fixing the postgre server? What errors do you see in the logs? – Mat Dec 24 '13 at 11:59
@Mat /var/log/pgsql is empty. grep -r "postgresql\-9\.3" /var/log output is boot log [fail] and binary wtmp match. I don't know where to search. – Anatoliy Gusarov Dec 24 '13 at 12:46
Assuming a default install of postgres is the same on Centos as on RedHat, you should look in /var/lib/pgsql/data/pg_log. – Mat Dec 24 '13 at 12:55
@Mat found log in /var/lib/pgsql/9.3/pgstartup.log found that I need to remove and start server. Server started, but now I can't connect to my db, now get error psql: FATAL: could not read block 3 in file "base/17832/12660": read only 0 of 8192 bytes =( – Anatoliy Gusarov Dec 24 '13 at 13:03
Nonono, do not just remove unless you've made absolutely certain that all PostgreSQL back-end processes are terminated, i.e. there's no postgres in a ps listing. Given the error, treat your DB as severely corrupt. Look at,, and this somewhat related post – Craig Ringer Dec 25 '13 at 9:03

Probably some system index or system table is broken. PostgreSQL reads these indexes on start. You can try to fix by REINDEX on system columns in single user mode. ATTENTION: this mode is very dangerous - and necessary to backup data directory first

(standalone console is leaved by pressing ctrl-d)

[postgres@nemesis pavel]$ /usr/local/pgsql/bin/postgres --single -D /usr/local/pgsql/data/ template0

PostgreSQL stand-alone backend 9.4devel
backend> REINDEX DATABASE template0;

Next, you can try start server

Thanks for the answer, but I reinstalled system and restored data from dump. BTW had problems with restoring data because I have two schemes - public and topology (postGIS ext.). I use Navicat Premium for windows, and have used dump function in it. As I am new in PostgreSQL I trusted to navicat and made two dumps - one for each topologies. Well, thing is that I have relations between tables in topologies, and separate restore of dumps was unsuccessful. But now I know how to create sequences =) – Anatoliy Gusarov Dec 30 '13 at 17:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.