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 1lodGa-0003g8-1H for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 02:39:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lodGZ-0005DF-0K for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 02:39:27 +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 1lodGY-0005D6-P3 for pgsql-hackers@lists.postgresql.org; Thu, 03 Jun 2021 02:39:26 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lodGW-0006QX-L4 for pgsql-hackers@postgresql.org; Thu, 03 Jun 2021 02:39:26 +0000 Received: by mail-io1-xd29.google.com with SMTP id z24so4789793ioi.3 for ; Wed, 02 Jun 2021 19:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vir9zPbjd7W/Sms2JzD/ROPmuy1sa7C4ssnFmVzVPmI=; b=xH5LG/LKl4NotVBq+kqGV8bu8M5i0ul62nqa/Ee/7oVEsJ9DOGD2rvPR0x5gcDgPEh s/e3CLhgcVTH7uWDNo1iaiJ5Va6a0KCAkTKs/4CwaWUukiXN0G0XC+VH9WW+CmgUhZIk rd7H0KQj4sTVw5Z2JEY/zb3/vJymD59iIubtlsAEbNTtTV454cFHqrNGJvmA+EmI4/Mk FfVCYnGAMGX1YuyPa8VJG74JPcFpklzd0cV5m3RZVDwUD4/twWTBzykdPyp/hLL2PM4r cGgg64y0INZw3YPZ1gP56xiBTmi/KZUbq3YEyf4hhNgdAt4CfxldkLIx0hnjSLGlV6sQ BR/A== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vir9zPbjd7W/Sms2JzD/ROPmuy1sa7C4ssnFmVzVPmI=; b=XfzDzMyXjmdxcEfPu73d/bOosOx8bV1SqvurllgK5+u/OWM+6NJePpdQeWNG0ZAAG8 FK61/8EHzL0RLj5SNnKjXdtv7KQRmh4hLHWZcrXLeyj2nLI2HV44JhWO5ovUQBNg1nAh Yzs9J9a95qfrZ66kRq8kXKwYqMcl0zHur/Qq3Am1Y5BArbPoQNHVZDr8FfHSfM9k/CKp 0NU1oc25QrVrbkppnNtTW6z69fGxKRnAgZX3x5ngmjePN6XpWcGsDsFFzo/KQiNL8zFp Qx292EcM9xDKaAm6aB/z2tR3/CK/i3xzCQiKmwZmPYkGn5ySDOGNvmxgqfv9GprM/NDF zyow== X-Gm-Message-State: AOAM532xYcZuSjHz4MWMfCRkoatIESzuIze2Epg3bMbdRb/0J1EBJs8d q702OzTPCX5Sv9tKctC7Vgxwww== X-Google-Smtp-Source: ABdhPJz1eAhL3A5kMseY8EgW7o/C1Bt9PmWncUI6P39Whmuu6lhxSellVDP+nS1HCNViVLg/jEuBVQ== X-Received: by 2002:a6b:4f1a:: with SMTP id d26mr26534191iob.85.1622687962232; Wed, 02 Jun 2021 19:39:22 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m7sm1037711ild.49.2021.06.02.19.39.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jun 2021 19:39:21 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A84908015C0; Wed, 2 Jun 2021 21:39:20 -0500 (CDT) Date: Wed, 2 Jun 2021 21:39:20 -0500 From: Justin Pryzby To: Tomas Vondra Cc: Dean Rasheed , pgsql-hackers@postgresql.org Subject: Re: PoC/WIP: Extended statistics on expressions (\d in old client) Message-ID: <20210603023920.GD14099@telsasoft.com> References: <2f2a3b3b-93e4-723f-144e-bc21f10d6b61@enterprisedb.com> <20210118045331.GF8560@telsasoft.com> <3f20da4d-89dc-0912-98d2-b6f0ef06c87f@enterprisedb.com> <20210122022958.GC27167@telsasoft.com> <20210122040101.GF27167@telsasoft.com> <04b100f9-201b-0bc8-c613-0f918451b599@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04b100f9-201b-0bc8-c613-0f918451b599@enterprisedb.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 22, 2021 at 02:09:04PM +0100, Tomas Vondra wrote: > On 1/22/21 5:01 AM, Justin Pryzby wrote: > > On Fri, Jan 22, 2021 at 04:49:51AM +0100, Tomas Vondra wrote: > > > > > | Statistics objects: > > > > > | "public"."s2" (ndistinct, dependencies, mcv) ON FROM t > > > > > > Umm, for me that prints: > > > > > "public"."s2" ON ((i + 1)), (((i + 1) + 0)) FROM t > > > > > > which I think is OK. But maybe there's something else to trigger the > > > problem? > > > > Oh. It's because I was using /usr/bin/psql and not ./src/bin/psql. > > I think it's considered ok if old client's \d commands don't work on new > > server, but it's not clear to me if it's ok if they misbehave. It's almost > > better it made an ERROR. > > > > Well, how would the server know to throw an error? We can't quite patch the > old psql (if we could, we could just tweak the query). To refresh: stats objects on a v14 server which include expressions are shown by pre-v14 psql client with the expressions elided (because the attnums don't correspond to anything in pg_attribute). I'm mentioning it again since, even though I knew about this earlier in the year, it caused some confusion for me again just now while testing our application. I had the v14 server installed but the psql symlink still pointed to the v13 client. There may not be anything we can do about it. And it may not be a significant issue outside the beta period: more typically, the client version would match the server version. -- Justin