Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhhWC-0005kd-Sn for pgsql-admin@arkaria.postgresql.org; Mon, 23 Jul 2018 20:33:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fhhWA-0008FO-S8 for pgsql-admin@arkaria.postgresql.org; Mon, 23 Jul 2018 20:33:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhhWA-0008F9-DJ for pgsql-admin@lists.postgresql.org; Mon, 23 Jul 2018 20:33:18 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fhhW7-00070m-Bw for pgsql-admin@lists.postgresql.org; Mon, 23 Jul 2018 20:33:17 +0000 Received: by mail-qt0-x242.google.com with SMTP id n6-v6so2019334qtl.4 for ; Mon, 23 Jul 2018 13:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=0b4iMiB+tylbRf213JvyZl8XciAaQIYrXtzY1rJjbWQ=; b=uBbSxsQvtqcOuUcFR2hF13T8XU6SJmGyhSzdMjYpxZQqW6x7jVsPCm/SDr+pVrFOfe Umb6YITgQHmAK0QPb+/5zxF138/ywmINjD7NKw0rcouFcLGkRcs13HHCtV7BKcnAMiEy wnuSbdKJXng2WCTJ5s8+Al9BRha95f2Gr5EpcDU43jYRNkLKcExe5bm8YebPu91XzJ+x TQs7x6i3i6au21eGqEoHiufngMy4hheVTQF+yxQe48pP4nuT1VrwVXis6aJ1U6BpqzdP LqLyH4lM6BwodQQPNYkCCwsliaWWI7XfwiaKuzngwcgikDG4iMWmFMwVc6QL8tIqtM0z ilsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=0b4iMiB+tylbRf213JvyZl8XciAaQIYrXtzY1rJjbWQ=; b=FZ4hYsMBUcu4eajldewzMWf5ZE5kRcZPrecilWciCdvewvuAX9RiAHh5KRN63s0Uc+ MXftS9/T1HWU769qdeLREndyn7/wVle9OgZi8ptxFzatJ7CcGCrQt8AxMZtqqLoLdppu MklwfY9yW3/y0oBgJKipv8eAcLGmaCMiHix1UQWBtmYiuU4VbXVz9QpMZyTjUpN+5Ctx 1RVOxiRnPOGbsCSrQwhsowCsupcL/QNOkiFKg0pLi/Nk5lZJR8VmOMoklJvRNYWxF6y+ mYeOGIjTHi8wu7DFd/naqzEDswE8qMlZwbgVvi7S4ZegySK9+j+6ySKxhbHOprQct/IS zr9Q== X-Gm-Message-State: AOUpUlFlcnYihsNEdz6vDcrDvfZXbPN7hjZwiY6ehyLFUdFxAAir8LuO G2S7uQX2GU5JXTdXlu9LRXL+nlDoukI= X-Google-Smtp-Source: AAOMgpfej23O1mm9SZvKatELQcMYM/y4YbiVCUQxj6IUXjTJ9ThG8GtHK2KZL1Fvt4LXKUDbrKc1Bw== X-Received: by 2002:a0c:d60f:: with SMTP id c15-v6mr6225281qvj.70.1532377994303; Mon, 23 Jul 2018 13:33:14 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.56.48.71]) by smtp.gmail.com with ESMTPSA id n21-v6sm7811753qkl.34.2018.07.23.13.33.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:33:13 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id D6EAAEED; Mon, 23 Jul 2018 16:33:11 -0400 (-04) Date: Mon, 23 Jul 2018 16:33:11 -0400 From: Alvaro Herrera To: Andres Freund Cc: Mariel Cherkassky , pgsql-admin@lists.postgresql.org Subject: Re: pg_authid has duplicated rows Message-ID: <20180723203311.7isul7yxziiw7wbx@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180723202645.dv47gmkbqk5kbrfr@alap3.anarazel.de> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Jul-23, Andres Freund wrote: > Hi, > > On 2018-07-23 21:03:32 +0300, Mariel Cherkassky wrote: > > Today I faced a situation where I saw a postgresql 9.2 database that had > > duplicated rows in pg_autid. I saw 6 roles while 3 of them were duplicated > > (3 uniques rolenames in total). I checked and the oid of the duplicates > > were the same oid as the originals. The solution was running vacuum on the > > table but I wanted to understand how this situation was created ? Why even > > with unique index on the rolname I saw duplicated values for rolname ? > > That suggests some form of corruption. Which version of 9.2 did this > occur on? Did you have any OS level crashes? Ran with fsync=off? I have vague memories of seeing this recently. Can you please show select xmin, xmax, ctid, oid, rolname from pg_authid And the output of pg_controldata. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services