Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQfGh-00082f-Lh for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 14:47:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UQfGh-0003dQ-6V for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2013 14:47:59 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQfGg-0003dL-Jq for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 14:47:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UQfGe-0003gr-9M for pgsql-bugs@postgresql.org; Fri, 12 Apr 2013 14:47:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r3CElq6Y017169; Fri, 12 Apr 2013 10:47:52 -0400 (EDT) From: Tom Lane To: Andres Freund cc: tarvip@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #8059: sequence crash recovery is not working properly In-reply-to: <20130412140416.GF5766@alap2.anarazel.de> References: <20130412140416.GF5766@alap2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 12 Apr 2013 16:04:16 +0200" Date: Fri, 12 Apr 2013 10:47:52 -0400 Message-ID: <17168.1365778072@sss.pgh.pa.us> X-Pg-Spam-Score: -4.3 (----) 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 Andres Freund writes: > Thats caused by the fact that you didn't do anything that forces a WAL > flush since you didn't do any inserts or such. If you would do any > DML in the nextval() calling transaction this shouldn't happen (unless > you use synchronous_commit=off). > Now, there's a legitimate argument to be made that returning the > sequence value to the user kinda persists it. On the other hand, at > least in the first example you haven't even committed the transaction so > there's nothing that could flush the transaction unless we we would > *always* flush nextval() immediately if needs to get new values which > doesn't seem reasonable. I believe we've gone around on this before and decided to leave it as-is. The thinking is that any realistic use-case would involve storing the nextval result into some table somewhere, so that additional WAL and a commit record would be generated. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs