Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMzcb-00070i-5X for pgsql-bugs@postgresql.org; Sat, 13 Oct 2012 11:11:09 +0000 Received: from mail-da0-f46.google.com ([209.85.210.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMzcU-00084j-Lr for pgsql-bugs@postgresql.org; Sat, 13 Oct 2012 11:11:08 +0000 Received: by mail-da0-f46.google.com with SMTP id n41so1751561dak.19 for ; Sat, 13 Oct 2012 04:11:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=+ajbxV8hw2wjdY53TFwRQa2ns8nuN+Vzny2a4Mk2ISo=; b=Ig6WUsO5SjZinWIN7Z3tBWLt6bwUgfBAPTfo/Zk6+wHkGrfpRhz/4bY3U/waZSG+aQ RwfSFqTSQ/sc4sa0IabYcwduuL5j6oddLVRUX+r0BUtDpmLfIssip2qtzAq9EfBuoQ3/ ihl2Iiwemg+Ti3gz2MvT1DcBLVUx2w4KZPWRhXMmenyI6EDgoQNxhQFzuUMGf1kBv111 VCUCDa0mKwiCRlQe1+1XnWLCQQbKve8SEk1pavluOygaOav6rMSzau8RJWs13OHf7eJj Q9rF5TCfH/OPa9jTPXJZk8GUSF/gfpahUohvFGC4v4VVuxJpqx2EYntVXucPshWl0Noi n+pA== Received: by 10.66.79.133 with SMTP id j5mr18245454pax.51.1350126660898; Sat, 13 Oct 2012 04:11:00 -0700 (PDT) Received: from ayaki.localdomain (58-7-144-234.dyn.iinet.net.au. [58.7.144.234]) by mx.google.com with ESMTPS id sa2sm5915326pbc.4.2012.10.13.04.10.57 (version=SSLv3 cipher=OTHER); Sat, 13 Oct 2012 04:10:59 -0700 (PDT) Message-ID: <50794C3E.3070608@ringerc.id.au> Date: Sat, 13 Oct 2012 19:10:54 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: hankiewicz@gmail.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7600: Database crash with data corruption References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlsol/NWuFxgQMyiQqafjTsbnqu7Ui1yw/gjt8067WGEB/zNSc3Hzg7gQMaxkcMBV6/wF77 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/114 X-Sequence-Number: 34414 On 10/12/2012 09:35 PM, hankiewicz@gmail.com wrote: > 5) after recovery was completed we have discovered that sequences on > production database had wrong values To follow up on Tom's explanation, if you're relying on sequences not having "holes" then your design is dangerously mistaken. A simple ROLLBACK throws away any IDs that were obtained from sequences in that transaction. If you're saying that the sequence is wrong in that it's LOWER than IDs present in the table, then that's a problem. -- Craig Ringer