Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aOA3G-0005Ou-OJ for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2016 20:17:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aOA3G-0002Ja-Av for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2016 20:17:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aOA2g-0007Xg-6E for pgsql-admin@postgresql.org; Tue, 26 Jan 2016 20:16:46 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aOA2Z-0006Yr-Hf for pgsql-admin@postgresql.org; Tue, 26 Jan 2016 20:16:45 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [212.76.254.194]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id EE355400B28; Tue, 26 Jan 2016 12:16:33 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id EB84BD0D; Tue, 26 Jan 2016 14:37:17 -0300 (CLT) Date: Tue, 26 Jan 2016 18:37:17 +0100 From: Alvaro Herrera To: Felipe Santos Cc: =?iso-8859-1?Q?Cl=E9cio?= Anderson , pgsql-admin@postgresql.org Subject: Re: pg_dump / pg_restore - TOC.dat file Message-ID: <20160126173717.GA565213@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org 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