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 1okQpS-00085g-KU for pgsql-general@arkaria.postgresql.org; Mon, 17 Oct 2022 14:10:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okQpR-0007Fy-DM for pgsql-general@arkaria.postgresql.org; Mon, 17 Oct 2022 14:10:53 +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 1okQmH-0006ab-Ek for pgsql-general@lists.postgresql.org; Mon, 17 Oct 2022 14:07:37 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1okQmF-00019c-FM for pgsql-general@lists.postgresql.org; Mon, 17 Oct 2022 14:07:36 +0000 Received: by mail-ej1-x62d.google.com with SMTP id q9so25310917ejd.0 for ; Mon, 17 Oct 2022 07:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=M4GobLHfPbSeczOwHdvum3ypP5HRp6FpcEHY8VS1CYc=; b=v0JWUgl+bb4n0cicIrUyhlYr0VisKFMOFp5eBdNAzcovBeW4cPEJRoer5NeVuKUgXJ yATmZ/0DHiCxnO2gdqHm4M7t5AHyIBUX/nXAa02CrTiXvLIHxvGYYNiJurx/rJJlt4X6 sIGCBCzgFpupFWQGeIDpW9C9qptSIwjSx9C7fbyNPcxDAnYvTTFZIhMdzl7/FKKVDPut pcF08BYFFu2l1HVgpcSKqzUhhpBjna3elyyHvoe00wVFvpJj7xr6pqbvOOIx2e8MHrSO pfsWyL0IBDtf0lGN6gERMclH6e678ESGzzCA6h0mJ/YvdPbQc6A4wEVZigujPX5hGUNV ajZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=M4GobLHfPbSeczOwHdvum3ypP5HRp6FpcEHY8VS1CYc=; b=fWmjws5gnm5aIfp2IJfSz3atjczSyfZG2Yq08cWADLVojwbINt+W58Um4L9wNTFgVn IYQQThfb2ynRHpEsd5EsBSkSsLfBLTCwo1PzhgUkkIYMLH8Yt7HJlDZlPc3gVT/FsbOr vv8YaEKerYQwr4ODjuvNyfb9BM5gKbJrySFeQ3YAYtIBe+jPhnRJrhfptir+O0Cbfm/d JRYW96dFa2R61J5DQ9AEGUXpeXm5pE7x4+jnh80BQU9mQbs1tuWa3H//lhHYCb1WgoqI qi8GDvYKPnGhBxTLBgpGOwP1qHkqZYf8wBAI5PXxzxVMtbMbmUvGwJUkWzdWYylMta+a Iguw== X-Gm-Message-State: ACrzQf1TF3MJvcltReEWjwKjkN2/dTCb2ozGMKa3UiWEQSoQ+pdONEX+ m1b3hHWLG1AVrhEAXJXiBZITKw== X-Google-Smtp-Source: AMsMyM77WzThFF9aCvyVKDcSg4VrR3ioHZ70KU8N6PbwbMLlB7ej3kJBL82YRMFe0uSgrktxV6vz+A== X-Received: by 2002:a17:906:5a69:b0:78d:e65b:e5a0 with SMTP id my41-20020a1709065a6900b0078de65be5a0mr8932565ejc.544.1666015654538; Mon, 17 Oct 2022 07:07:34 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:d12d:ae5:7ec0:d4cc:73f8]) by smtp.gmail.com with ESMTPSA id i24-20020a056402055800b004588ef795easm7449322edx.34.2022.10.17.07.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 07:07:34 -0700 (PDT) Message-ID: <7ea51194f227584cc85a428bc4ef5d39ed36f5b8.camel@cybertec.at> Subject: Re: =?UTF-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9A=E5=9B=9E=E5=A4=8D=EF=BC=9A?= =?UTF-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9AA?= question about leakproof From: Laurenz Albe To: qiumingcheng , Tom Lane Cc: Julien Rouhaud , pgsql-general , yuexingzhi Date: Mon, 17 Oct 2022 16:07:33 +0200 In-Reply-To: <195c5d95-8749-4419-a4f4-604cc8c937ec.qiumingcheng@aliyun.com> References: <9cc93fdc-2f99-4963-b895-169135b742a8.qiumingcheng@aliyun.com> <20221017014020.qpu2f5yy4lridhic@jrouhaud> ,<2067840.1665971686@sss.pgh.pa.us> <9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com> ,<2077794.1665977617@sss.pgh.pa.us> ,<9e253a3226436819f0aaf59fb82137477d9f5a78.camel@cybertec.at> <195c5d95-8749-4419-a4f4-604cc8c937ec.qiumingcheng@aliyun.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2022-10-17 at 16:24 +0800, qiumingcheng wrote: > > "you seem to be imagining that changes in a query's plan on the basis of changes > > in collected statistics have something to do with this.  They do not." > > 1. My understanding of the above paragraph is that for the same view and different users, > the proleakproof=false attribute of the function will not lead to inconsistent plans, > but my actual test result is that proleakproof=false will lead to inconsistent plans. The above says "on the basis of changes in collected statistics". The different execution you see is not because the statistics are different, but because the permissions of the users are different. > 2. What's the reason about the function timestamp_gt_timestampz  may  cause data leakage? > Can you explain how it causes data leakage? I don't know the reason in this case. You could look at the source code, perhaps it is possible to cause error messages that can give you some clue as to the value that you compare with. But perhaps, as Tome said, it is just that nobody scrutinized the function hard enough to exclude that something like that can happen. Yours, Laurenz Albe