Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQuLE-0002Sh-Af for pgsql-general@arkaria.postgresql.org; Sun, 25 Nov 2018 13:20:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gQuLC-00033U-TH for pgsql-general@arkaria.postgresql.org; Sun, 25 Nov 2018 13:20:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gQuLC-000327-8V for pgsql-general@lists.postgresql.org; Sun, 25 Nov 2018 13:20:50 +0000 Received: from stz-bg.com ([2a02:6800:0:99::2] helo=mail.stzbg.com) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gQuL3-00072b-9b for pgsql-general@lists.postgresql.org; Sun, 25 Nov 2018 13:20:48 +0000 Received: from www.stz-bg.com (stz-bg.com [IPv6:2a02:6800:0:99::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: condor@stz-bg.com) by mail.stzbg.com (Postfix) with ESMTPSA id 5C2F12E0842; Sun, 25 Nov 2018 15:20:36 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stz-bg.com; s=mail; t=1543152036; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2bpxU6xAnahcZcZVafcMcxr9UQKTDYiCsvUIcJfpCeY=; b=RCSUkkX0suKwzaIG9CYFhK9rtViUC6VIBzJMXAulJhkB/b/PEiiUdkICImWrJ8z3K8oGyf FXurCkfK7RtErAsVeoYkQ3ibqBrX5cYXj8LCwK2NWdqyX+iV+t5wnnONcLz6OH8ncZYR8y ho9ft5u8IS9YWX7zElSTXHlY7osSVQQ= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Sun, 25 Nov 2018 15:20:35 +0200 From: Condor To: Alexey Bashtanov Cc: pgsql-general@lists.postgresql.org Subject: Re: Question about index on different tablespace and rebuild it In-Reply-To: <6ade500f-cbe2-cb5e-8382-4b6a01ccf6df@imap.cc> References: <816583dfa3eb6ce411cc7c987aabc4c4@stz-bg.com> <6ade500f-cbe2-cb5e-8382-4b6a01ccf6df@imap.cc> Message-ID: X-Sender: condor@stz-bg.com User-Agent: Roundcube Webmail/1.3.8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 16-11-2018 19:40, Alexey Bashtanov wrote: >> Yes, I know. My question is: Did the pg server will start at all if=20 >> the NVME / table space somehow is broken and indexes is unable to be=20 >> loaded, not how to drop an index. >> Since the Postgre server is not starting at all maybe I can try=20 >> dropping my indexes on my pocket calculator all day long. >>=20 >> When the data is separated, is there any other tool that can rebuild=20 >> my indexes located on broken tablespace, having of course in mind,=20 >> that Data in >> the index is stored separately from the table. I guess the pg server=20 >> wont start and for that reason I try to explain and wonder if the data= =20 >> and index is separated >> probably pg devs have a way to rebuild these indexes somehow when pg=20 >> server is offline. >>=20 > Unfortunately it doesn't sound like something feasible to me, at least > without deep hacking of postgres itself. >=20 > To start after a crash, the server needs to apply the WAL records > since last checkpoint, and they need data files to be binary the same > as before the crash. > So the index file not only needs to be there and not too corrupted, > but should have its pages and their contents to be located physically > in the same order, > which depends on the prior history of the table updates. >=20 > Postgres manual explicitly warns that all the tablespaces need to be > preserved in order to started the server. > The only possible exclusion may be temp_tablespaces and unlogged and > temporary tables -- kind of grey zone, people do it but the manual > don't allow this trick. >=20 > See also=20 > https://blog.2ndquadrant.com/postgresql-no-tablespaces-on-ramdisks/ >=20 > Best regards, > =C2=A0 Alexey Thank you for your answer. It's seems this is a weak spot of Postgres. Best regards, HS