Re: pg_dump / pg_restore - TOC.dat file - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: pg_dump / pg_restore - TOC.dat file
Date
Msg-id 20160126173717.GA565213@alvherre.pgsql
Whole thread Raw
In response to Re: pg_dump / pg_restore - TOC.dat file  (Felipe Santos <felipepts@gmail.com>)
Responses Re: pg_dump / pg_restore - TOC.dat file  (Clécio Anderson <clecioanderson@gmail.com>)
List pgsql-admin
Felipe Santos wrote:

> 11471; 1262 36497111 DATABASE - mydb postgres
>
> 11471 - ?
> 1262 - ?
> 36497111 - Object ID
> DATABASE - Object Type
> mydb - Object Name
> postgres - Object Owner

The code that writes this is PrintTOCSummary() in
src/bin/pg_dump/pg_backup_archiver.c -- see that if you want more
details.  (Each object here is a TocEntry struct, which is defined in
pg_backup_archiver.h, search for _tocEntry.  Useful comments there.)

11471 is the internal ID of the object in the dump.  Note that ; is a
comment delimiter for the TOC format, so if you just write the 11471 in
a separate line, the correct object is specified.  The rest of the
entries after the ; are just commentary so that the DBA can understand
what the entry is for.

1262 is the OID of the pg_database catalog, so this identifies the entry
as a database.  This is redundant with having DATABASE in the object
type.  Similarly, 36497111 is the pg_database.oid column which is
redundant with having mydb as the database name.

The hyphen - is for the schema, if the object belongs into a schema.
A database obviously doesn't have one, hence the - in this particular
sample.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: custom log. variable %h reports [unknown]
Next
From: Clécio Anderson
Date:
Subject: Re: pg_dump / pg_restore - TOC.dat file