2

I'm trying to understand if it's possible to include in database backup also unlogged table.

http://www.postgresql.org/docs/9.3/static/sql-createtable.html

Here it's explained that on crash table is truncated (as expected), but no reference to backuping or take a daily "screenshot".

Someone have some experience?

I'm using PostgreSQL 9.2.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
Luigi Saggese
  • 5,299
  • 3
  • 43
  • 94

1 Answers1

5

Unlogged tables are always included in dumps (pg_dump) unless you explicitly specify the --no-unlogged-table-data command line option.

Unlogged tables are also included in file-system level backups taken when the databases server is stopped after a clean shutdown.

Unlogged tables are never included in pg_basebackup, streaming replication or WAL archiving backup and PITR. There is no option to include them, because to include them they'd have to be logged, and then they wouldn't be unlogged tables anymore.

In general, if you wish to back up unlogged tables, they probably should not be unlogged, because an unlogged table is erased completely if PostgreSQL or the server crashes or shuts down unexpectedly.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778