Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WxCpZ-0004CR-Cn for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Jun 2014 10:11:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WxCpY-00032k-Oz for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Jun 2014 10:11:00 +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 1WxCpX-00032d-Px for pgsql-bugs@postgresql.org; Wed, 18 Jun 2014 10:10:59 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WxCpP-0000v8-TL for pgsql-bugs@postgresql.org; Wed, 18 Jun 2014 10:10:58 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id BD5A64E8006; Wed, 18 Jun 2014 12:10:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC41C0.dip0.t-ipconnect.de [93.220.65.192]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 051B94E8003; Wed, 18 Jun 2014 12:10:46 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 8D7241010D8; Wed, 18 Jun 2014 12:10:45 +0200 (CEST) Date: Wed, 18 Jun 2014 12:10:45 +0200 From: Andres Freund To: Pavan Deolasee Cc: "maxim.boguk" , Pg Bugs Subject: Re: BUG #10675: alter database set tablespace and unlogged table Message-ID: <20140618101045.GG3115@awork2.anarazel.de> References: <20140617032438.2585.42918@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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-06-18 15:33:58 +0530, Pavan Deolasee wrote: > On Wed, Jun 18, 2014 at 12:31 PM, Pavan Deolasee > wrote: > > > > > Attached patch fixes this for the HEAD. But this needs to be fixed all > >> the way to 9.1 when unlogged tables were first introduced. > >> > > > > > I'd forgotten to update the comment in the code. Fixed in the attached > version. > > Thanks, > Pavan > > -- > Pavan Deolasee > http://www.linkedin.com/in/pavandeolasee > diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c > index c070278..e0b9aff 100644 > --- a/src/backend/storage/buffer/bufmgr.c > +++ b/src/backend/storage/buffer/bufmgr.c > @@ -1221,11 +1221,12 @@ BufferSync(int flags) > ResourceOwnerEnlargeBuffers(CurrentResourceOwner); > > /* > - * Unless this is a shutdown checkpoint, we write only permanent, dirty > - * buffers. But at shutdown or end of recovery, we write all dirty > - * buffers. > + * If a force checkpoint or at shutdown or end of recovery, we write all > + * dirty buffers, otherwise we only write permanent buffers > */ > - if (!((flags & CHECKPOINT_IS_SHUTDOWN) || (flags & CHECKPOINT_END_OF_RECOVERY))) > + if (!((flags & CHECKPOINT_IS_SHUTDOWN) || > + (flags & CHECKPOINT_END_OF_RECOVERY) || > + (flags & CHECKPOINT_FORCE))) > mask |= BM_PERMANENT; Won't that significantly regress manually issued CHECKPOINT;s? 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