Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAYHl-0005BE-1A for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 19:09:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAYHj-001XUY-0Q for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 19:09:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAYHi-001XUQ-2X for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 19:09:55 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAYHh-000000003Ld-1TIh for pgsql-hackers@postgresql.org; Wed, 08 Apr 2026 19:09:55 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-4232323a7daso72934fac.1 for ; Wed, 08 Apr 2026 12:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775675391; x=1776280191; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rNAqIGnrDJlmt6Zvwa1lNKt4zsKmFSyzFAvFXNz2lgc=; b=Bt0r3QA3gE5dqQXpE5F1iD+sSKU1e4GeTRWhWdxQraUEMyuhb4zpix1XFvUscaxFkB VbFmccCDoeyX8OkIqhEN1rw6nxsuNccDw1m1ZwV3P/1WHc7SzTNGsbCldd6t6ATTENKI olZ+ellc9hVH73GGqWkA7GWbAxL5B6/OJluIh0aYlYqYyQli+J2e9d3okP4PX9zojJM+ AurUmL3CNaDDH/0oKljXiEtVKwDZOrfEwx2b2Borq05gO61sx67lMwHPBNASTaH7vLOq tDNDKK3/1sx78o7x5O6383VL955vONVFiZ16DzHGfho+Olr+HFZEW3+1uqObmd43fnIW eVaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775675391; x=1776280191; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rNAqIGnrDJlmt6Zvwa1lNKt4zsKmFSyzFAvFXNz2lgc=; b=ahIjASbhOpnn6b8hlNvIEBN22+QUz4f1Ouwzif7X8cad3We9m93/Ql+HurhotsI56k lslJgHAe/3rK56CxFHiwyMkeZgj5hbcTADnYpPJhmndC7ceclO0rEBNB+LYS91vDurcq KnZ5eZd7u1fqrAHvTWSM5yLim73aQROIcEB7EmHDiFJnGcjdM5UawzT2e0bJSx0HV1o3 cUgZTXo09aUyWAXhGFRnDiCzyVcn+yDtGhAOVwEUvdelwlC7mlEmMo6TbMKeSes+7n5c pDB6hcbo9K3JxR5mNX/3lj/nHTrpmVHCovJy++QNnxNTrR09Kyf+YsB81FwgXIyebeUS JZUA== X-Forwarded-Encrypted: i=1; AJvYcCWNC2ULtNCifxIjO4Pgu126l1ARztCX9xD/0BOY6m4rqHP76jignVK/sSj1yU5AVsFJC36p2xzqxr2XeLF1@postgresql.org X-Gm-Message-State: AOJu0Yyrz79o4ZELE3Pbgmf8DI81ZObJxRsvvTvX5uVVe0ry+roMWsiZ nUTcnnvlau+d8uc8t0N9p0kSHi0vzNhIkAB6WCkg/jhqZNnDzhukXpE5 X-Gm-Gg: AeBDieteJOOsmRpS6MT6AgdZVXSxfxK675eVzckYLtchkjrXfmyfRBTNUBglwMx61/f mlTbOqyKj2+ta9gFvQTdt1D55A1JqBGVL9D4zDxly2osgfrKjMbBfqNVESDRMSi/hr7jJ8PIMC9 G07Vx0emPccLxRdaXqNOCLPq3+udqzFpgkhkkOnbTGwr+TNBLTloH0gYldg3C9EHtjtWGvCVaDI cQaPs5Wx86S65bRObSybz7LwbZ0oOAuwT0f8vDHTgrLUfLDFBPr1PHncl1aZ+G8xNfuPC2fHgPg EVD+oq5zCTVnrdiU69v6wSqrwk+Gd1/qZQaBv/7UVivaz6NXtlEUcUnXDmelRXZGaAb0hetIveg PfbicEflIg7/5ilfOPNa6qn8JLfFsa66km9S+GNie+1YlbaBlyM7jVOm9C+6atPr/JFLzWy1Owd W3GMRR297jzKj+ixyF/KtQ/t3wh9u06J9LXvscL58YDS4bVUPpk0GdAQVxidzEDjpcadZWwDCNh md9NkioaDdkxK/zW66vxA== X-Received: by 2002:a05:6870:de10:b0:417:33a7:1032 with SMTP id 586e51a60fabf-423bdbc6f2amr372360fac.25.1775675390958; Wed, 08 Apr 2026 12:09:50 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-422eb25acbesm19812317fac.11.2026.04.08.12.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 12:09:50 -0700 (PDT) Date: Wed, 8 Apr 2026 14:09:48 -0500 From: Nathan Bossart To: Tom Lane Cc: Alexander Lakhin , Sami Imseih , Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers , tndrwang@gmail.com Subject: Re: Add pg_stat_autovacuum_priority Message-ID: References: <5684f479-858e-4c5d-b8f5-bcf05de1f909@gmail.com> <3077290.1775668665@sss.pgh.pa.us> <3097984.1775674400@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3097984.1775674400@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 08, 2026 at 02:53:20PM -0400, Tom Lane wrote: > Oh. I'm not happy that any part of autovacuum.c is now reachable from > SQL: that's the sort of modularity violation that will bite us on the > ass (indeed just did). Aside from this problem, the elog's that > relation_needs_vacanalyze emits seem 100% inappropriate and misleading > when it's being called from the view. FWIW that elog() shouldn't be emitting anything from the view, unless something is broken. > I think perhaps the right way forward is to rethink the API > guarantees for pgstat_fetch_stat_tabentry_ext, as I speculated > about in 02502c1bc: > > [...] > > 2. Add a "bool *should_free" parameter, like we have in tuplestores > and some other places. It's on the caller to pfree if should_free > gets set, but since we'd have to touch every caller, we'd not miss > any. This sounds most similar to the "bool *may_free" idea that Andres just posted. IIUC the idea is that callers can free the result if they want, but they aren't required to do so. -- nathan