pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump / pg_restore - TOC.dat file
4+ messages / 3 participants
[nested] [flat]

* pg_dump / pg_restore - TOC.dat file
@ 2016-01-26 05:12 Clécio Anderson <clecioanderson@gmail.com>
  2016-01-26 10:02 ` Re: pg_dump / pg_restore - TOC.dat file Felipe Santos <felipepts@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Clécio Anderson @ 2016-01-26 05:12 UTC (permalink / raw)
  To: pgsql-admin

Hi guys!

Does anyone knows the meaning of each collumn in TOC.dat file generated by
pg_dump?

For example:

;
; Archive created at Thu Jan 21 18:36:25 2016
;     dbname: mydb
;     TOC Entries: 7528
;     Compression: -1
;     Dump Version: 1.12-0
;     Format: DIRECTORY
;     Integer: 4 bytes
;     Offset: 8 bytes
;     Dumped from database version: 9.3.5
;     Dumped by pg_dump version: 9.3.5
;
;
; Selected TOC Entries:
;
11471; 1262 36497111 DATABASE - mydb postgres
7; 2615 36497112 SCHEMA - acl postgres
11472; 0 0 ACL - acl postgres
179; 1259 36497634 TABLE acl tb_log postgres
11514; 0 0 ACL acl tb_log postgres
180; 1259 36497638 TABLE acl tb_paper postgres
11515; 0 0 ACL acl tb_paper postgres
181; 1259 36497643 TABLE acl tb_paper_group postgres
11516; 0 0 ACL acl tb_paper_group postgres
182; 1259 36497646 TABLE acl tb_permission postgres
11517; 0 0 ACL acl tb_permission postgres

At the first line for example..

11471; 1262 36497111 DATABASE - mydb postgres

What each collumn means? What 11471 means? or 1262 or 36497111.... and so
on..

Thanks in advance for your help and time!

-- 
*Tecnólogo em Redes de Computadores*

*Currículo Lattes <http://lattes.cnpq.br/0641375920107155>*
*MCTS *
*| MCITP | LPIC-2 | ITIL Foundation*

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump / pg_restore - TOC.dat file
  2016-01-26 05:12 pg_dump / pg_restore - TOC.dat file Clécio Anderson <clecioanderson@gmail.com>
@ 2016-01-26 10:02 ` Felipe Santos <felipepts@gmail.com>
  2016-01-26 17:37   ` Re: pg_dump / pg_restore - TOC.dat file Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Felipe Santos @ 2016-01-26 10:02 UTC (permalink / raw)
  To: Clécio Anderson <clecioanderson@gmail.com>; +Cc: pgsql-admin

2016-01-26 3:12 GMT-02:00 Clécio Anderson <clecioanderson@gmail.com>:

> Hi guys!
>
> Does anyone knows the meaning of each collumn in TOC.dat file generated by
> pg_dump?
>
> For example:
>
> ;
> ; Archive created at Thu Jan 21 18:36:25 2016
> ;     dbname: mydb
> ;     TOC Entries: 7528
> ;     Compression: -1
> ;     Dump Version: 1.12-0
> ;     Format: DIRECTORY
> ;     Integer: 4 bytes
> ;     Offset: 8 bytes
> ;     Dumped from database version: 9.3.5
> ;     Dumped by pg_dump version: 9.3.5
> ;
> ;
> ; Selected TOC Entries:
> ;
> 11471; 1262 36497111 DATABASE - mydb postgres
> 7; 2615 36497112 SCHEMA - acl postgres
> 11472; 0 0 ACL - acl postgres
> 179; 1259 36497634 TABLE acl tb_log postgres
> 11514; 0 0 ACL acl tb_log postgres
> 180; 1259 36497638 TABLE acl tb_paper postgres
> 11515; 0 0 ACL acl tb_paper postgres
> 181; 1259 36497643 TABLE acl tb_paper_group postgres
> 11516; 0 0 ACL acl tb_paper_group postgres
> 182; 1259 36497646 TABLE acl tb_permission postgres
> 11517; 0 0 ACL acl tb_permission postgres
>
> At the first line for example..
>
> 11471; 1262 36497111 DATABASE - mydb postgres
>
> What each collumn means? What 11471 means? or 1262 or 36497111.... and so
> on..
>
> Thanks in advance for your help and time!
>
> --
> *Tecnólogo em Redes de Computadores*
>
> *Currículo Lattes <http://lattes.cnpq.br/0641375920107155>*
> *MCTS *
> *| MCITP | LPIC-2 | ITIL Foundation*
>




11471; 1262 36497111 DATABASE - mydb postgres

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

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump / pg_restore - TOC.dat file
  2016-01-26 05:12 pg_dump / pg_restore - TOC.dat file Clécio Anderson <clecioanderson@gmail.com>
  2016-01-26 10:02 ` Re: pg_dump / pg_restore - TOC.dat file Felipe Santos <felipepts@gmail.com>
@ 2016-01-26 17:37   ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2016-01-26 20:21     ` Re: pg_dump / pg_restore - TOC.dat file Clécio Anderson <clecioanderson@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Alvaro Herrera @ 2016-01-26 17:37 UTC (permalink / raw)
  To: Felipe Santos <felipepts@gmail.com>; +Cc: Clécio Anderson <clecioanderson@gmail.com>; 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


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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump / pg_restore - TOC.dat file
  2016-01-26 05:12 pg_dump / pg_restore - TOC.dat file Clécio Anderson <clecioanderson@gmail.com>
  2016-01-26 10:02 ` Re: pg_dump / pg_restore - TOC.dat file Felipe Santos <felipepts@gmail.com>
  2016-01-26 17:37   ` Re: pg_dump / pg_restore - TOC.dat file Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2016-01-26 20:21     ` Clécio Anderson <clecioanderson@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Clécio Anderson @ 2016-01-26 20:21 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Felipe Santos <felipepts@gmail.com>; pgsql-admin

Thanks Alvaro and Felipe for your answers. ;D

2016-01-26 14:37 GMT-03:00 Alvaro Herrera <alvherre@2ndquadrant.com>:

> 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
>



-- 
*Tecnólogo em Redes de Computadores*

*Currículo Lattes <http://lattes.cnpq.br/0641375920107155>*
*MCTS *
*| MCITP | LPIC-2 | ITIL Foundation*

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-01-26 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 05:12 pg_dump / pg_restore - TOC.dat file Clécio Anderson <clecioanderson@gmail.com>
2016-01-26 10:02 ` Felipe Santos <felipepts@gmail.com>
2016-01-26 17:37   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-01-26 20:21     ` Clécio Anderson <clecioanderson@gmail.com>

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