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.96) (envelope-from ) id 1vWcrB-0065bF-31 for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 15:57:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWcrA-008FJX-1m for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 15:57:29 +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.96) (envelope-from ) id 1vWZna-007hqn-2A for pgsql-general@lists.postgresql.org; Fri, 19 Dec 2025 12:41:35 +0000 Received: from smtpout05.dka.mailcore.net ([185.138.56.205]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWZnZ-001VIM-0m for pgsql-general@postgresql.org; Fri, 19 Dec 2025 12:41:34 +0000 Received: from SMTP.DKA.mailcore.net (unknown [10.1.0.52]) by SMTPOUT01.DKA.mailcore.net (Postfix) with ESMTP id 26AB5E0059 for ; Fri, 19 Dec 2025 13:41:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=online.ee; s=mailcore; t=1766148091; bh=KIZKuMRaEnwpy0HaK32W7b7qChYxifczUeIKSCKhZjY=; h=Date:To:From:Subject:From; b=erxfKEJP28E/bL4qfJBn0VFEWqJiB+RFWXInn9zqEtb2iGitp7eVL89LpWmPqwy3o ZqnrYwZTL3rcevc6VLYfJ8/N+mLR3pbSKGwkye0eBO0HOdRoMuD5HnLtluXH41p30L 8QKgn+s6UlSGIqPCYhWzlRCxd4BxFShGc7wMWiFfIGJ07Jfb5QmiRQ0+5O52K6afbm dsxSnBEpn+TZYnmil5zYt2c7AHh1Dhnq8c2rXREvLvcqXnTY4uMaEFdGch/ib55ZKl CRa84GlOLnHVFcTlDFmcvsD9eDvp+qpme94+jRX9Wxvo73xgSySd4jVbRo5pkYDt5a x3MX4zP1AFHOw== Received: from [192.168.1.38] (73-142-35-213.sta.estpak.ee [213.35.142.73]) by SMTP.DKA.mailcore.net (Postfix) with ESMTPSA id 048444019E for ; Fri, 19 Dec 2025 13:41:30 +0100 (CET) Content-Type: multipart/alternative; boundary="------------4lBpmS00tIH0lZ4jBupE8c43" Message-ID: Date: Fri, 19 Dec 2025 14:41:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: et To: pgsql-general From: Andrus Subject: How to get single table data from backup List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------4lBpmS00tIH0lZ4jBupE8c43 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi! Large database backup is created using pg_dump -b -f backup.backup -F c How to restore single table in schema firma2 from it in Windows? Created database recovery and tried pg_restore --schema-only --n firma2 -d recovery backup.backup pg_restore -n firma2 -t tabletorecover -d recovery backup.backup This fails since tabletorecover contains lot foreign key references. Foreign keys refer to other tables which have foreign keys to another tables etc. making huge graph. All tables contain also data. I need to get table data only. Using PostgresSql 17 in windows. Andrus. --------------4lBpmS00tIH0lZ4jBupE8c43 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi!

Large database backup is created using

pg_dump -b -f backup.backup -F c 

How to restore single table in schema firma2 from it in Windows? 

Created database recovery and tried

pg_restore --schema-only --n firma2 -d recovery backup.backup
pg_restore -n firma2 -t tabletorecover -d recovery backup.backup

This fails since tabletorecover contains lot foreign key references. Foreign keys refer to other tables which have foreign keys to another tables etc. making huge graph. All tables contain also data.

I need to get table data only. Using PostgresSql 17 in windows.

Andrus.


--------------4lBpmS00tIH0lZ4jBupE8c43--