Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jegwW-0006BM-NY for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2020 15:29:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jegwV-0008H0-KK for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2020 15:29:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jegwU-0008Gt-Uh for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2020 15:29:07 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jegwN-0001b7-TQ for pgsql-hackers@postgresql.org; Fri, 29 May 2020 15:29:05 +0000 Received: by fetter.org (Postfix, from userid 1001) id D0AED40DC0; Fri, 29 May 2020 17:28:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fetter.org; s=default; t=1590766137; bh=pZ/01K/sHYfXjG78y8n18GEYd7s8H6oOartxqG+A+bA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VYDKdxgJlObmewRSm1K0fhgoMsdL9Bzib969afxCjYVLRPdB6OC5zxg5l5SKxO8Rg qq5sr08FHsWAgCowllqzv5WVnFWn/bII5r1smRWJfTBIppUvQcmPIZyvsCMAr4Fwsm 1I+YlJn4f81K+R1Of0KH+cik+EE1WODV9HEOM6n0oZZv5gn18WV4NrXvHIW6Q7iaYn v0fn47gPPuoxTVOYavhoxl1zTjKbU4EKS0VcVvhJQKVQuQdLGFaNiH9lJInZDsSdMC 9AzadJrsnGg+LsERqZjO6foeT5X0oMfb0M36Nj9rjcU/cFqb7pXtKJrN3qZh0/ttX9 vDkLnAcVEBRiw== Date: Fri, 29 May 2020 17:28:57 +0200 From: David Fetter To: Pavel Stehule Cc: PostgreSQL Hackers Subject: Re: proposal: possibility to read dumped table's name from file Message-ID: <20200529152857.GP13741@fetter.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, May 29, 2020 at 04:21:00PM +0200, Pavel Stehule wrote: > Hi > > one my customer has to specify dumped tables name by name. After years and > increasing database size and table numbers he has problem with too short > command line. He need to read the list of tables from file (or from stdin). > > I wrote simple PoC patch > > Comments, notes, ideas? This seems like a handy addition. What I've done in cases similar to this was to use `grep -f` on the output of `pg_dump -l` to create a file suitable for `pg_dump -L`, or mash them together like this: pg_restore -L <(pg_dump -l /path/to/dumpfile | grep -f /path/to/listfile) -d new_db /path/to/dumpfile That's a lot of shell magic and obscure corners of commands to expect people to use. Would it make sense to expand this patch to handle other objects? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate