Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fweZH-0000RD-G8 for pgsql-general@arkaria.postgresql.org; Mon, 03 Sep 2018 02:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fweZF-00045W-Tv for pgsql-general@arkaria.postgresql.org; Mon, 03 Sep 2018 02:26:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fweZF-00045P-In for pgsql-general@lists.postgresql.org; Mon, 03 Sep 2018 02:26:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fweZD-0007mt-39 for pgsql-general@lists.postgresql.org; Mon, 03 Sep 2018 02:26:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w832QC7V013489; Sun, 2 Sep 2018 22:26:12 -0400 From: Tom Lane To: Ron cc: pgsql-general@lists.postgresql.org Subject: Re: dat names generated by pg_dump In-reply-to: <0ddc55d3-d7b7-a765-5548-0d847b41d941@gmail.com> References: <0ddc55d3-d7b7-a765-5548-0d847b41d941@gmail.com> Comments: In-reply-to Ron message dated "Sun, 02 Sep 2018 19:40:16 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13487.1535941572.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 02 Sep 2018 22:26:12 -0400 Message-ID: <13488.1535941572@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron writes: > I can associate these dat names with their source tables through a bunch= of = > bash and vim manual operations, but I was wondering if there's any autom= ated = > method (maybe some SQL query of some catalog table; pg_class didn't seem= to = > have the relevant data) of making the association. Those numbers are the "dump object IDs" generated by pg_dump. They don't have any significance on the server side, and typically would vary from one pg_dump run to another. You have to look at the dump TOC (table of contents) to figure out what corresponds to what. For example, $ pg_dump -Fd -f dumpd regression $ ls -1 dumpd 6143.dat.gz 6144.dat.gz 6145.dat.gz ... blob_3001.dat.gz blobs.toc toc.dat $ pg_restore -l dumpd ; ; Archive created at 2018-09-02 22:14:48 EDT ... 6573; 2613 119655 BLOB - 119655 postgres 6574; 2613 3001 BLOB - 3001 postgres 6603; 0 0 COMMENT - LARGE OBJECT 3001 postgres 6247; 0 100933 TABLE DATA public a postgres 6212; 0 89417 TABLE DATA public a_star postgres 6180; 0 88516 TABLE DATA public abstime_tbl postgres 6218; 0 89444 TABLE DATA public aggtest postgres 6446; 0 121383 TABLE DATA public alter_table_under_transition_tables postg= res ... The numbers before the semicolons are the dump IDs. In particular $ pg_restore -l dumpd | grep 6143 6143; 0 88018 TABLE DATA public int4_tbl postgres so 6143.dat.gz contains the data for table public.int4_tbl. There will only be separate files in the dump directory for TABLE DATA and BLOB dump objects ... other stuff is just embedded in the toc.dat file. regards, tom lane