pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Felipe Santos <felipepts@gmail.com>
Cc: Clécio Anderson <clecioanderson@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump / pg_restore - TOC.dat file
Date: Tue, 26 Jan 2016 18:37:17 +0100
Message-ID: <20160126173717.GA565213@alvherre.pgsql> (raw)
In-Reply-To: <CAPYcRiVZhqojx0jko8fTgivNighFasKSH_=VL2Qx3+qjEOSc_Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <20160126173717.GA565213@alvherre.pgsql>
Permalink:  ../20160126173717.GA565213@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160126173717.GA565213@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@2ndquadrant.com, felipepts@gmail.com, clecioanderson@gmail.com
  Subject: Re: pg_dump / pg_restore - TOC.dat file
  In-Reply-To: <20160126173717.GA565213@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox