0

I am trying to view a database created on a different system in my current installation of postgres.

I downloaded the same version of postgres (9.6) and replaced the data folder with the data folder from the other system, but when I look at the database in pgadmin, only the default tables are present.

I am also confused by the directory structure. The directory structure I copied over is /data/base, four number directors and "pgsql_tmp." What do these numbers mean?

1 Answers1

0

I am also confused by the directory structure. The directory structure I copied over is /data/base

See Database File Layout in the 9.6 documentation for the explanation of the directory structure.

Your $PGDATA seems to be /data, thereforce you need to copy all of that.

The reason why you don't see the target databases with the partial copy is probably that pg_database is stored in /data/global. Note that the fact that the instance starts at all seems lucky. It could refuse to start, or start and become corrupt very quickly. The data files under $PGDATA/base are generally not portable across instances, because they contain metadata with transaction IDs.

The $PGDATA directory as a whole is portable only if the destination has exactly the same architecture, same operating system and same major version of Postgres.