Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFm0i-0004gy-Nt for pgsql-sql@arkaria.postgresql.org; Tue, 30 May 2017 18:36:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dFm0i-0006je-AZ for pgsql-sql@arkaria.postgresql.org; Tue, 30 May 2017 18:36:52 +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 1dFlzf-0004u6-6x for pgsql-sql@postgresql.org; Tue, 30 May 2017 18:35:47 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dFlza-0006w9-LA for pgsql-sql@postgresql.org; Tue, 30 May 2017 18:35:46 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 209F920C67; Tue, 30 May 2017 14:35:41 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 30 May 2017 14:35:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=9POztKReAyK0Ksa4+9 6jSQSw0gqRy8nuKB6w/udHqU4=; b=USa+EMrNzQ5yjod3yAHXY6jBL2t/ZVAh5i IFfVw1BHrf94cXnOhhGzl9nxUEXP0w5Ql3ybGopW5rXTjUNLDEf4gz7HcaDk221j SNdekDzMrJH/Cc5K6Ur9kIN2ybLQmysLuG2np87qh1IVagNQh+URMlHjGVjrWu5w 8LF1QX4IhJflyYcUNhcQHqBLYvHPcIBSW9t+PgVDwl5pNa2NhzzNc5Ix9EEO/X5o n5+yvHjljV2SaEpr2fLp7RA2dK/p/OmLA70oWSQo+srEpm9otCWDRyVtfGvzGcFd G0fmGdscwn1iuW1mM/HxnuqFM7M1oEphhJs0U+ml/DoFOKbdvn8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=9POztKReAyK0Ksa4+96jSQSw0gqRy8nuKB6w/udHqU4=; b=rlUbeP2a bhBrddp+GFVqhsyMgDn4Xw24mSzMWruqronvDs5GVOpIXasA2ePpZabZ8CSOJ/DM tgtDnTvrcFN9ThJwK2hJqCZsBZTaJN6OvEMUDdnpKPuKD16jTYz5fx0n8XyVSI3F U1Ge16BZKDtODBtjovFH8pFfdHY+0pm3mlhZvx4hM5izDBcUcw7SduGLjO3ctnjY QFV/P7IMAkWJJAVEZTRNKIqZJkFBsk7pg0coQafOR8tYbgTkbD0ewC2DazsYhZGF 3ArL3sFc1hH4eiNnU8SyzRto4LOA1bdSSWXCXF/vL+dW22fh/qppHQ2sswp6xu/y wQVlIlY1gDttJg== X-ME-Sender: X-Sasl-enc: wC9LwF7RCtEv4jD8LLgW8t+BNLwwb+d+xZIYNaMFf2/Q 1496169340 Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 1A23C7E794; Tue, 30 May 2017 14:35:40 -0400 (EDT) Subject: Re: Lost my tablespace To: tel medola Cc: pgsql-sql@postgresql.org References: <2a418dab-d17f-9d3a-0ac4-53678c1ce16f@aklaver.com> <97bd2743-46c3-32c4-7b3f-62def38aea65@aklaver.com> <32bb9df2-3b4d-95cb-1f82-8da675536a9b@aklaver.com> <100e137f-4510-031c-1fa5-51b2a145f39a@aklaver.com> From: Adrian Klaver Message-ID: Date: Tue, 30 May 2017 11:35:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) 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 On 05/30/2017 07:56 AM, tel medola wrote: > Looks to me like the above is inheriting itself, note the non-schema > qualified repositorio. Pretty sure that is not good > /I realized this too, I looked in other banks (of other applications) > that I have, and this information is the same: "Têm OIDs: não"/ "Têm OIDs: não" is not part of the problem. Many years ago user tables where created with a system column oid. This turned into a problem and now user tables are not created with an oid column. It is still possible to create or alter a table to have an oid column(I would not suggest that). That is what "Têm OIDs: não" is showing. > > So I assume the other repositorio tables in the other schemas are as > above but pointing at different tablespaces, correct? > /Yes/ > > Understood. Still one of the issues is not providing information from > explicit commands provided. As an example in previous post I had: > /Ok. Thanks! / > / > / > /rai=# show search_path;/ > / search_path/ > /--------------------------------------------------------/ > / 1052016, 5122016, 13042017, 22082016, 30122015, public/ > /(1 registro)/ So if you do: \d+ *.repositorio you should see all the repositorio tables. > > > It is important remember is that what is obvious to you looking at the > terminal is not so obvious on this end. To understand what is going on > we need specific information. > /Understood/ > > > I understand the pressure you are under. I am going to be heading out to > work here shortly and will not be able to help for awhile. I am not sure > where you are, but you might want to look here: > /Ok, very thanks./ > > > As I remember 13042017.repositorio is something you created after the > TRUNCATE. > So where did the 491 GB in data come from? > Can it be used to seed the other tables? > > /I always use the public.repository table for the preliminary > information. After drive C: gets full, I move the data to a new > tablespac on another drive and then do the truncate of the public. After > that, I relink the inheritance with the new table created (in the new > tablespace) so that postgres can extract the data automatically./ > /The schema(13042017) was done this way (after the wrong truncate)./ To be clear the tablespace for public.repositorio is the default one in $PGDATA on the C:\ drive, correct? So is there anything in public.repositorio now? Before I forget and for future use: 1) Truncate is transaction safe so can be done in a BEGIN/ROLLBACK or COMMIT sequence. Though if you are space constrained on C:\ I am not quite sure if truncating 400GB+ of data in an open transaction might not cause space issues also. 2) TRUNCATE has an ONLY option that restricts the action to the named table only and not its descendant(child) tables: https://www.postgresql.org/docs/9.6/static/sql-truncate.html Is the data in 13042017.repositorio the data you want? If so why not use that data to reseed the other child tables? > > 2017-05-30 11:21 GMT-03:00 Adrian Klaver >: > > On 05/30/2017 06:50 AM, tel medola wrote: > > That despite recovering the backup, I can not access my data. So > I posted that I lost my tablespaces. > /Aware, thanks. In the next email I'll be careful about that/ > / > / > > > See comments inline. > > Did you try my previous suggestions:/ > / > /Yes, but dont list all tables, in all schemas/. > /Bellow the main table/: > > /rai=# \d+ public.repositorio;/ > / Tabela > "public.repositorio"/ > / Coluna | Tipo | > Modificadores | Armazenamento | Estatísticas | Descrição/ > /---------------+-----------------------------+-----------------------+---------------+--------------+-----------/ > / id_documento | character(39) | > | extended | |/ > / documento | bytea | > | extended | |/ > / nomedocumento | character varying | > | extended | |/ > / id | character(39) | nÒo nulo > | extended | |/ > / datahora | timestamp without time zone | valor padrÒo de > now() | plain | |/ > / id_itemtype | bigint | nÒo nulo > | plain | |/ > /═ndices:/ > / "repositorio_pkey" PRIMARY KEY, btree (id)/ > / "repositorio_iddocumento" btree (id_documento) WITH > (fillfactor=100)/ > */Tabelas descendentes: "01052016".repositorio,/* > */ "05122016".repositorio,/* > */ "22082016".repositorio,/* > */ "30122015".repositorio,/* > */ repositorio/* > > > Looks to me like the above is inheriting itself, note the non-schema > qualified repositorio. Pretty sure that is not good. > > /Têm OIDs: não/ > > > rai=# \d+ 01052016.* > Tabela > "01052016.repositorio" > Coluna | Tipo | > Modificadores | Armazenamento | EstatÝsticas | DescriþÒo > ---------------+-----------------------------+-----------------------+---------------+--------------+----------- > id_documento | character(39) | > | extended | | > documento | bytea | > | extended | | > nomedocumento | character varying | > | extended | | > id | character(39) | nÒo nulo > | extended | | > datahora | timestamp without time zone | valor padrÒo de > now() | plain | | > id_itemtype | bigint | nÒo nulo > | plain | | > ═ndices: > "repositorio_pkey" PRIMARY KEY, btree (id) > "repositorio_id_documento_idx" btree (id_documento) WITH > (fillfactor=100) > *Heranças: public.repositorio* > *Têm OIDs: não* > *Tablespace: "disco02"* > > > ═ndice "01052016.repositorio_id_documento_idx" > Coluna | Tipo | DefiniþÒo | Armazenamento > --------------+---------------+--------------+--------------- > id_documento | character(39) | id_documento | extended > btree, para tabela "01052016.repositorio" > Opþ§es: fillfactor=100 > > > ═ndice "01052016.repositorio_pkey" > Coluna | Tipo | DefiniþÒo | Armazenamento > --------+---------------+-----------+--------------- > id | character(39) | id | extended > chave primßria, btree, para tabela "01052016.repositorio" > > > So I assume the other repositorio tables in the other schemas are as > above but pointing at different tablespaces, correct? > > > /Adrian, I see you really want to help me, thank you very much > for that. I apologize if at any point I did not quite understand > what you meant, it is that writing in English is not the best. > > > Understood. Still one of the issues is not providing information > from explicit commands provided. As an example in previous post I had: > > What does: > > show search_path; > > return? > > It is important remember is that what is obvious to you looking at > the terminal is not so obvious on this end. To understand what is > going on we need specific information. > > > / > /But I need to know where you want to get the questions, because > the logical links in the table are all correct, but for some > reason Postgres can not access my data and I'm practically > losing my job because I can not deliver the information I should./ > > > I understand the pressure you are under. I am going to be heading > out to work here shortly and will not be able to help for awhile. I > am not sure where you are, but you might want to look here: > > https://www.postgresql.org/support/professional_support/ > > > for folks close by that could help. > > > /Is there a way to get access to this data again?/ > > > One thing that I have not understood is: > > Esquema | Nome | Tipo | Dono | Tamanho | Descrição > ----------+-------------+--------+----------+------------+----------- > 01052016 | repositorio | tabela | postgres | 8192 bytes | > 05122016 | repositorio | tabela | postgres | 8192 bytes | > 13042017 | repositorio | tabela | postgres | 491 GB | > 22082016 | repositorio | tabela | postgres | 8192 bytes | > 30122015 | repositorio | tabela | postgres | 8192 bytes | > > > As I remember 13042017.repositorio is something you created after > the TRUNCATE. > > So where did the 491 GB in data come from? > > Can it be used to seed the other tables? > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql