Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VvQpu-00064X-S3 for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Dec 2013 12:11:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VvQpu-0007dN-BV for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Dec 2013 12:11:46 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VvQpt-0007dH-KF for pgsql-bugs@postgresql.org; Tue, 24 Dec 2013 12:11:45 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VvQpl-0004GJ-2F for pgsql-bugs@postgresql.org; Tue, 24 Dec 2013 12:11:45 +0000 Received: from intern.anarazel.de (p549F1FCD.dip0.t-ipconnect.de [84.159.31.205]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 498084F0001; Tue, 24 Dec 2013 13:11:36 +0100 (CET) Date: Tue, 24 Dec 2013 13:11:35 +0100 From: Andres Freund To: digoal@126.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8697: checkpoint cann't flush unlogged table's dirty page to disk. Message-ID: <20131224121135.GE26564@alap2.anarazel.de> References: 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 Hi, On 2013-12-23 09:41:07 +0000, digoal@126.com wrote: > checkpoint cann't flush unlogged table's dirty page to disk. > digoal=# create table u(id int); > digoal=# update pg_class set relpersistence ='u' where relname='u'; > digoal=# insert into u select generate_series(1,100000); > digoal=# checkpoint; > digoal=# select * from pg_stat_file(pg_relation_filepath('u')), > pg_relation_filepath('u'); > size | access | modification | change > | creation | isdir | pg_relation_filepath > ---------+------------------------+------------------------+------------------------+----------+-------+---------------------- > 3629056 | 2013-12-23 17:36:54+08 | 2013-12-23 17:37:02+08 | 2013-12-23 > 17:37:02+08 | | f | base/16399/122891 > (1 row) > -- then change table u to normal table > digoal=# update pg_class set relpersistence ='p' where relname='u'; > digoal=# insert into u select generate_series(1,100000); > digoal=# checkpoint; > digoal=# select * from pg_stat_file(pg_relation_filepath('u')), > pg_relation_filepath('u'); > size | access | modification | change > | creation | isdir | pg_relation_filepath > ---------+------------------------+------------------------+------------------------+----------+-------+---------------------- > 7249920 | 2013-12-23 17:36:54+08 | 2013-12-23 17:37:29+08 | 2013-12-23 > 17:37:29+08 | | f | base/16399/122891 > (1 row) I am confused. It certainly isn't allowed to simply update random pg_catalog.* tables - it will frequently break stuff. Why are you expecting that to work? Or are you simply trying to prove some other point? 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