Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFMq1-0002VR-Jg for pgsql-sql@arkaria.postgresql.org; Mon, 29 May 2017 15:44:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dFMq0-0000Yo-UQ for pgsql-sql@arkaria.postgresql.org; Mon, 29 May 2017 15:44:08 +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_2) (envelope-from ) id 1dFMp0-0007E6-Er for pgsql-sql@postgresql.org; Mon, 29 May 2017 15:43:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dFMox-0000mC-4m for pgsql-sql@postgresql.org; Mon, 29 May 2017 15:43:05 +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 v4TFgxmh010662; Mon, 29 May 2017 11:42:59 -0400 From: Tom Lane To: tel medola cc: pgsql-sql@postgresql.org Subject: Re: Lost my tablespace In-reply-to: References: Comments: In-reply-to tel medola message dated "Mon, 29 May 2017 11:10:16 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10660.1496072579.1@sss.pgh.pa.us> Date: Mon, 29 May 2017 11:42:59 -0400 Message-ID: <10661.1496072579@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org tel medola writes: > I have a serious problem in my database. I have a table, divided into 4 > tablespaces, one in each unit (E :; G :; H:; I:), linked with inheritance, > of approximately 500 gb each. It happens that a truncate was done in the > main table without undoing the inheritance for the other tables and > consequently the "daughters" tables were cleaned together with the main > one. I lost everything! But ... I have the backup of all drives and I have > already done the data restore. Everything has been successfully retrieved, > however the table is listed as 8192 bytes in postgres, but the units are > all as they were before the truncate was executed. > Is there any way Postgres redo the link with the child tables ?? I already > ran the command to rewrite inheritance, but the size of the tables > continues with 8192. This doesn't sound like a problem. This sounds like a misunderstanding of what table size means. If you do "select from" the main table, do you see rows from the child tables? If so, the inheritance is fine. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql