Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does each column in an archive's table of contents mean? (pg_dump/pg_restore)

Tags:

postgresql

I'm using pg_restore to reconstitute a database I've backed up. As suggested in the pg_restore docs (https://www.postgresql.org/docs/curren/app-pgrestore.html), I've created a .list file with the archive's table of contents.

Nothing is wrong per se, but I'm struggling to figure out what every column in this ToC means. They each look like this:

5602; 0 16476 TABLE DATA public <table_name> postgres

The first column is the archive id for that table, but what do the next two numbers mean? In my ToC the first non-archive column is always zero but in other examples that's not true.

like image 727
a3r0d7n4m1k Avatar asked Oct 15 '25 18:10

a3r0d7n4m1k


1 Answers

The fields pertain to:

  • Archive ID
  • Catalog Table OID (0 in your case, because that row pertains to TABLE DATA and not a table. A proc would get the value of SELECT oid FROM pg_class were relname = 'pg_proc' here, a table would get SELECT oid FROM pg_class where relname = 'pg_class', etc.)
  • Table OID (16476 is the oid you would find in pg_class)
  • Description (TABLE DATA in your example)
  • Schema (public in your example)
  • Name (<table_name>)
  • Owner (postgres in your example)
like image 153
richyen Avatar answered Oct 18 '25 07:10

richyen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!