Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMqcy-0050Vj-0j for pgsql-admin@arkaria.postgresql.org; Thu, 27 Jun 2024 15:01:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sMqcw-00AdpR-Ae for pgsql-admin@arkaria.postgresql.org; Thu, 27 Jun 2024 15:01:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMqcv-00AdpH-W8 for pgsql-admin@lists.postgresql.org; Thu, 27 Jun 2024 15:01:34 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMqco-003Oyk-TM for pgsql-admin@lists.postgresql.org; Thu, 27 Jun 2024 15:01:32 +0000 Message-ID: Date: Thu, 27 Jun 2024 18:01:22 +0300 MIME-Version: 1.0 Subject: Re: Incorrect syntax when restoring a single table Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: From: Achilleas Mantzios - cloud In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/27/24 17:01, Ron Johnson wrote: > PG 16.3 > > Obviously I've overlooked something, but can't see what it is. > > DB name is "tap". > pwd is the directory above where the directory-format backup is located. > > I'm trying to restore the single table tapschema.batch_rp4_y2022m08 to > the existing database named "tap". > > The (compressed) backup file is about a megabyte, so there's data in > it.  However, when I run the "pg_restore -t" command, it connects, but > doesn't restore anything. > > $ pg_restore -l -Fd -f tap.list tap > > $ grep " batch_rp4_y2022m08 " tap.list > 2118; 1259 1814433 TABLE tapschema batch_rp4_y2022m08 fis_tap > 128513; 0 0 TABLE ATTACH tapschema batch_rp4_y2022m08 fis_tap > 847489; 0 1814433 TABLE DATA tapschema batch_rp4_y2022m08 fis_tap > > $ dir tap/847489* > -rw-r--r-- 1 postgres postgres 1067185 2024-06-27 02:31:24 > tap/847489.dat.gz > > $ pg_restore -v -a -t tapschema.batch_rp4_y2022m08 -Fd --dbname=tap tap > pg_restore: connecting to database for restore > > $ psql tap -c "select count(*) from batch_rp4_y2022m08;" >  count > ------- >      0 > (1 row) Is your search_path correct ?