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 1vwQfe-006IOk-36 for pgsql-docs@arkaria.postgresql.org; Sat, 28 Feb 2026 20:12:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwQfd-00BUJk-15 for pgsql-docs@arkaria.postgresql.org; Sat, 28 Feb 2026 20:12:13 +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 1vwQfd-00BUJb-0E for pgsql-docs@lists.postgresql.org; Sat, 28 Feb 2026 20:12:13 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vwQfZ-00000001m43-1U2h for pgsql-docs@lists.postgresql.org; Sat, 28 Feb 2026 20:12:12 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-4398d1f06caso2932497f8f.0 for ; Sat, 28 Feb 2026 12:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1772309528; x=1772914328; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=1Kf8XjrrBVehMqm7YzFrQFe1TQv7o4foYqCMhbWc1yA=; b=VD+g8s2TA1PFnjs11Vo0vScM47jB1RYqpQd2MEfigFhT5ZzSsRAjan2ej22ivCxI+r bYWGoLPTa46TgQ8tn9tQURQ/CdcBYHN4FoUZLa/bLeCS/yEMaRdHIKZjjiGGQCHi6ZdY qbKemQqE3cOlP0f5yU9ezIXGCZissN2+v7K6EdmaBmdr41HilQ9cm5eS/gcqcm8JfcZC Ud0pmnOaIqIT7cLk3XDfSLiBLGEvsDbDLiAyEIayl6Ed88sTL1NxMvz1QEpTlgBGIFyI If8DEZ1jAo6um0wE4QrdHaucwrfbnNsxAsCGdh+QU2mAq/17G4BhifnQS0ROLifFKHMv pCQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772309528; x=1772914328; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1Kf8XjrrBVehMqm7YzFrQFe1TQv7o4foYqCMhbWc1yA=; b=IXM8Le1xwRzxti+vt5faUg5FuAX/PtPECI34mK5JAoTyRuOii1XZeyguVhAscHYLp/ NlGH1Hy8LyUi0y8QTPtWmAhLrupmwyHW99KV3FLEoUksohux0CfMEX1ZuvFaewG6bdHL 8JwZx9sSvcEI3EGMLQkIJG2IhgXR5ME8xyf7CFk9qoAI54aNDy8DONS0Tnt6ta5Vrzuj fHGM6USJESjBP4aLiKE8SmGEXvA4l+cP41JT8NDrXmSE2UBHXHw8MxBBZ1/ShLJYv6pB 9AHdyRfjYyWSTDm8lUU6zZ0pvvFTdmdbTPA2F8k+M6j+qVvTbriRgnEiyI/b1eUT8t2h P3sg== X-Forwarded-Encrypted: i=1; AJvYcCX3LHbkeqfnOQz2FEWQzZH2uNATifdZCrdxnhpV1PkQflfgKQOoofzXBkc7/XYD6f2kQIHQ9VQyHNuQ@lists.postgresql.org X-Gm-Message-State: AOJu0Yya7FNUdWpbT7qngpg5CPtBQjTzYbOSXMn+QJ2Z0Cd9laMNxzL4 MvYoSjoA2gBwYksHU3bW+QgjLZmNMhiClIky9/N4UX1o51YDN7wB14Ckq1/HIKSlVy8= X-Gm-Gg: ATEYQzytQ4eQjq3VgkYmkWCoklEvzWnlR/Afg/fnQ19LqSqH7eMozVnnfdYt/JlZTmV /uEUdUIzeF3Z6Daf4O/fDVnREqup9pPJ4UBUDmBXNioNN3UU5Yl3dzUGxIxQXP7CeoLz0wl+8zJ ucFnwobZJPlyFdExxYpV1na2+JwH5On5VPnGKBwhFwAeErMgg+aQrcxCFuq9FIMpBfSv7miGHoa HGwziqRXoyQmOSsW4GmzGCVVxLSTU+b3RxnkBtuL0LQTjPfR+HIiGtjbm+jRYDGbcH/0vT5nh1x CQjsAR0yEcsIrgrPcg0c0HJMtVJGAFwNYx7qmb1R3DA1/ZTbMA4PHdXUis/ICqDI4V1CvrnsDEP h3dcb2t2Ssi+ukoJEjw7xe5Zv9VSNlnAGzEVCyH3Wqf+8rGqpp7skyGoCDDD4ta7lxyLhjdDp6F svbGD4aGIv1GMXbC3XLwyP0B0eyxgNUAcWd1qUqbQL5xUzieUoMHXVh3cXUK7DCDQlOw== X-Received: by 2002:a05:6000:22c9:b0:435:9a50:bbb4 with SMTP id ffacd0b85a97d-4399de3356fmr12473013f8f.59.1772309527592; Sat, 28 Feb 2026 12:12:07 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:270:4cd4:ad4e:e4e4:66cb:81ac]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4399c76c49fsm16260676f8f.38.2026.02.28.12.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Feb 2026 12:12:07 -0800 (PST) Message-ID: <1223bd05e1482396b63c9ffc01dee7e7f357babe.camel@cybertec.at> Subject: Re: Documentation incorrect pg_partition_root function description. From: Laurenz Albe To: udv.mail@gmail.com, pgsql-docs@lists.postgresql.org Date: Sat, 28 Feb 2026 21:12:06 +0100 In-Reply-To: <177226779035.3161255.9286174854079010253@wrigleys.postgresql.org> References: <177226779035.3161255.9286174854079010253@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2026-02-28 at 08:36 +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: >=20 > Page: https://www.postgresql.org/docs/18/functions-admin.html > Description: >=20 > https://www.postgresql.org/docs/current/functions-admin.html >=20 > pg_partition_root ( regclass ) =E2=86=92 regclass > Returns the top-most parent of the partition tree to which the given > relation belongs. Returns NULL if the relation does not exist or is not a > partition or partitioned table. >=20 > "does not exist" is not correct description, if table does not exist, we'= ll > get an error, not NULL: >=20 > EXAMPLE: > SELECT * FROM pg_partition_root( 'nonexisting_table' ); >=20 > RESULT: > SQL Error [42P01]: ERROR: relation "nonexisting_table" does not exist > Position: 34 The error you are getting is *not* from pg_partition_root(), but from the cast from "text" to "regclass": SELECT 'nonexisting_table'::regclass; ERROR: relation "nonexisting_table" does not exist LINE 1: SELECT 'nonexisting_table'::regclass; ^ And if you take a "regclass" that corresponds to an object ID that is not the object ID of any existing relation, you get a NULL result: SELECT pg_partition_root('12345'::regclass); pg_partition_root=20 ------------------- =20 (1 row) Yours, Laurenz Albe