Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olwGl-0005xd-JW for pgsql-general@arkaria.postgresql.org; Fri, 21 Oct 2022 17:57:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1olwGk-0002dg-AA for pgsql-general@arkaria.postgresql.org; Fri, 21 Oct 2022 17:57:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olwGj-0002dX-Ip for pgsql-general@lists.postgresql.org; Fri, 21 Oct 2022 17:57:17 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olwGg-00075V-N2 for pgsql-general@postgresql.org; Fri, 21 Oct 2022 17:57:17 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B73075C00A2; Fri, 21 Oct 2022 13:57:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 21 Oct 2022 13:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1666375032; x= 1666461432; bh=ONc2UG6j+m8+FBsJz1meh7tc/OMh0iLT9irBmn7dO/M=; b=L 3tZYDdohL2j/JY/5xgJ31oWI7dsCdbgNjw17K/Bnnp4kGOVX8mTamZ1Gr0DO/muE 2JfJClwoOjfH3uybXL1/X5QprtD7DhTTFeYH5N1jxwVnPre6TPA6ET5FzmAhUBwu 5iokIpBIlRu7nshXD1GSPBix+sg+hvVh/BmVNa1tOyIlHgz/c1t5k9YKe8qGPPeH Rgzbm3HDIfoyAh2JfXYLa17gcrzauYyVmOtUopHejVTNqcgFT+C2hXlrtwyhNiPB y/MXj2NA/axGxX1rt3ulJJfc4GKJT4OE6Ol4u4cEX/aisXSBgy48TBO8KjW8Audl 0BtTN5xC6dd+H+Go2JUeg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1666375032; x=1666461432; bh=O Nc2UG6j+m8+FBsJz1meh7tc/OMh0iLT9irBmn7dO/M=; b=oKRADrk6xSq9GY6gE 9R94hzCFARZy/bMIbaY3eNwDaFRImTLuMFcfC04yYP1XHX5lUXOE+iMZ6HIuKP7d 44XlpVTFvqAbDnLqr9vM6UUyD0GWCRVQdbWROBgEzkFjzdiy1lXeAqmv47ccyKyD OdtTQ5fAdZN7D1/tBJFdWS9N6ey9EYLn8kcDO2jvtxp1sahI42kQZFiQKReyyL8J ziuEcPsWle6RXPP6OhNVsRyIks5fYgF6x4G1O6vHZsY3m+k30+R8pCZdaS1K/NCX j2DEIo9KRhzOvqp71U8yvQLeSXor4e0UgoPbozLA3ieRqK3KsaCYdOs2OGIV/xV+ p5Urw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelkedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevveefve efueegffekkefhgeeiueffgfetueejvdfghfeujeejhfekjeelgedtgeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Oct 2022 13:57:12 -0400 (EDT) Subject: Re: possible bug To: Les , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: <454edd02-f3ab-4fa2-08e1-9658e27eaa0c@aklaver.com> Date: Fri, 21 Oct 2022 10:57:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/21/22 10:50 AM, Les wrote: > Hello, > > We had a support request today, and we have narrowed down the problem to > a query that behaves very strangely. The actual query was much more > complicated, but I came up with this minimal example. > > This is what we have seen inside our application: > > select * from test where id in (26643094740, 26437091668); > > id         |code|regno|col_3| > -----------+----+-----+-----+ > 26437091668|TA-T| 2632|    1| > 26643094740|PEG | 2905|    1| > > select * from test where id = 26643094740; > > id         |code|regno|col_3| > -----------+----+-----+-----+ > 26643094740|PEG | 2905|    0| > > The problem: value of col_3 changes for id=26643094740 if I query two > rows vs. one row. This is without changing any data. The problem is 100% > repeatable, if I query two rows from the same view, then I get different > data for one of the rows. > > I suspect that this is a bug. But I might be wrong. Please help me! I suspect an index problem. Have you tried reindexing the source table, kap.course if I am following correctly. Have there been any issues with the database lately, e.g. crash or other significant event? > > The actual test view looks like this: > -- Adrian Klaver adrian.klaver@aklaver.com