Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XHc56-00006T-DE for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Aug 2014 17:11:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XHc55-0002rT-TQ for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Aug 2014 17:11:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XHc55-0002rH-Aj for pgsql-bugs@postgresql.org; Wed, 13 Aug 2014 17:11:23 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XHc51-0005wS-Kk for pgsql-bugs@postgresql.org; Wed, 13 Aug 2014 17:11:22 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 81601560002; Wed, 13 Aug 2014 19:11:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-6.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC5C53.dip0.t-ipconnect.de [93.220.92.83]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 8B7B8500001; Wed, 13 Aug 2014 19:11:12 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id D6D8710086E; Wed, 13 Aug 2014 19:11:11 +0200 (CEST) Date: Wed, 13 Aug 2014 19:11:11 +0200 From: Andres Freund To: Vik Fearing Cc: MauMau , Pavan Deolasee , Tom Lane , "maxim.boguk" , Pg Bugs Subject: Re: BUG #10675: alter database set tablespace and unlogged table Message-ID: <20140813171111.GG14949@awork2.anarazel.de> References: <20140618110240.GJ3115@awork2.anarazel.de> <11621.1403099146@sss.pgh.pa.us> <20140618141949.GC3968@awork2.anarazel.de> <246F964E3CEB4B8D85FC5876CA37CC36@maumau> <20140813130720.GC28982@awork2.anarazel.de> <149312E3EED04551A6E5F394AF029DF2@maumau> <20140813143258.GD28982@awork2.anarazel.de> <53EB95C9.1020004@dalibo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53EB95C9.1020004@dalibo.com> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2014-08-13 18:43:53 +0200, Vik Fearing wrote: > There is also this issue which has been bugging me for a while but I > haven't had time to look at providing a patch for: > > postgres=# create unlogged table t (id integer); > CREATE TABLE > postgres=# insert into t values (1); > INSERT 0 1 > postgres=# create index on t using hash (id); > CREATE INDEX > > > > postgres=# set enable_seqscan = off; > SET > postgres=# select * from t where id = 1; > ERROR: index "t_id_idx" contains unexpected zero page at block 0 > HINT: Please REINDEX it. > > All because the init fork is never checkpointed to disk. If there's > anywhere a hash index should be safe to use, it's on unlogged tables. I don't think this really is related. For one, this this surely can't be fixed with anything checkpoint related. The overhead of that would be prohibitive. Other *builempty routines use smgrimmedsync(), but hash doesn't. That's the problem here. Note that that still won't make it safe across streaming rep et al.... Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs