Re: Lost my tablespace

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: tel medola <tel(dot)medola(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Lost my tablespace
Date: 2017-05-29 14:23:00
Message-ID: 2a418dab-d17f-9d3a-0ac4-53678c1ce16f@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 05/29/2017 07:10 AM, tel medola wrote:
>
> I have a serious problem in my database. I have a table, divided into 4

Postgres version?

> tablespaces, one in each unit (E :; G :; H:; I:), linked with

So for OS some version of Windows, correct?

> 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.

What was the command?

> If you execute the SELECT command pg_size_pretty (pg_database_size
> ('database_name')), the result comes complete, as if the tables were
> filled normally.

What does

select * from pg_tablespace;

show?

What does $PGDATA/pg_tblspc show?

> Can someone help me please?
> Thanks Roberto.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message tel medola 2017-05-29 14:39:14 Re: Lost my tablespace
Previous Message tel medola 2017-05-29 14:10:16 Lost my tablespace