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 1wRcWl-002Wcw-0y for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2026 21:07:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRcVk-0028Ce-12 for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2026 21:06:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wRcVj-0028CV-2o for pgsql-hackers@lists.postgresql.org; Mon, 25 May 2026 21:06:56 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRcVi-00000000kss-47KU for pgsql-hackers@postgresql.org; Mon, 25 May 2026 21:06:55 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-91173f20ccdso438998885a.0 for ; Mon, 25 May 2026 14:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779743213; cv=none; d=google.com; s=arc-20240605; b=PmHJHkL7iZVtNEjizwrREqk+x9xIjGDIEBEtI/UngHyjpeMhpG6QfI6AQKFyO3Er9u R7xNrc5/kTO8yBsmKc0x/T+M4yqjNT5t9tS6/QleoynmzeqVJQkuOX7LrPtdyFXGlhku LzVHuQ577XyhafaVFLn0iM79zPzKE1TLW6zYJD0kHJuRUUV0SKDep8ltu5FdhId6EMOE M1S9U8hEXlgP2TNmlbDTKIPL7pFtr9F1gyF8ysICiaLnkWtTjS+z28g+KLblVi1bBF68 nETN0TCmf0xsKMRnI4KNpSz55ceHJY4xbOTfiHl9TUBGVsNWEOakv6ZTXEjbbcAUSxQ0 X5YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FscX/GprT7YUGDJgqpmcpPeaMqzDTwV93OkFB3E2Sac=; fh=FcMKdMkvlv6T6sMOlpD72CnR78J2GmD5H1DrwrDnkwA=; b=TE195E0Te5xpnyInpM/PUriVCCQIvjp6WavPl7EhKMWB1EH49mSHZURMknWp3nKiAL BpBpkxdjvvatwM+nyzgbMSZQYDLGR2abeJq6dtoDdJNIxwXhtEswOD5K+S+uTE+Nqwn2 btgwGQnnwWC7tpThDVpf1bv1bQhNjo5pYBE/Q179z400JwdDDHIO1uSm2RktTuMJoNMr 1IYItNeaab3xO1hyeIe2Qlyp9wwlHllJwQeaeIw/a4ZWDI/1fm3MUVxUsyQsu+UhsGRx xDw+sb4vl4uSOKArOvb+JO0d2yWw2omZxHpgkwOyY3ZfXGg8aVXnFXSubrgaNqbnPSmp b9ZQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cleverelephant.ca; s=google; t=1779743213; x=1780348013; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FscX/GprT7YUGDJgqpmcpPeaMqzDTwV93OkFB3E2Sac=; b=CB/sQQQMKh7w7Fds1NLmk7K+7Qd2VZxCH2VfKN/YPV9yE6dDAUPad+2QPVA0+V86Ck U5WRNaRPQqaw9trV3FLooEkZNDo9/DMf9isLgubBSgUcypex9v/1laMLcJxG191IewuC xDP7psBoOcsRVqytkOvb76MCv46rRCxVnXDBYScze3aC0A74ZaTRjcUryIHfj858ZmwM uytgSHGVqgD32eEqQ6l6OhfHUfP30VJXDeRBrqSbFYRDnAzC2CNrGvP86gnJAzgFuvMP fn2mcBf8fGsCCrTZdtfFrzRgk36SG94IvLi3wO6ceUbjyrbvrvCcZ9Vq7H9+JCHTzels a/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779743213; x=1780348013; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FscX/GprT7YUGDJgqpmcpPeaMqzDTwV93OkFB3E2Sac=; b=lE0cOeeAQyqkc6J2y7XBacax/FdHO9nqa4vJdC4Ooof0pxlvSfp6ggNFqnKmP1gr1X tmu/rppigGttsXgy/dM6FYyY2N8zgLowFl/EZvnzH8DGhrN28IGlsWCDC/GWWOqh0JrB ZkQvYG6tMnLtEx3N3XKYOR6Gu39RSy1aZ6gf8MWFHZ8QxnqUy+4BVLaSF9IRFvOwhbF/ cBp+0+U9/8kv46ZR+3wyU8qQZ1eanChFtSrHB/DsThzU6KnacDsgNnKokmS2b18UFCAU harpH67Ouv99q17Dh8ID1VjyqJnuBL8y3KAAWbq/CFwejC/BbfrSx+Ad2BVanvLgibbP qTOw== X-Forwarded-Encrypted: i=1; AFNElJ/Nro0jmMltqJzCphnxmqfjYxmp9CQKHCbCAiiAGwjtDt/K8YK5UpvNnDH0aid57SabYU6ykTqUtzJz5rCj@postgresql.org X-Gm-Message-State: AOJu0YxF6zG6CKd+QcN2EZjnl0XxBhNrqoN148WcZDTBpMUaGNLWVgh/ TCovEu+MqmoVM4rHWHyZtbqqI38tnmeAmFBDZxb1o1F10hfjY88uT4jCBH8eUFXzp32zG2HnSSN tqF6mvgvPyKFA8eKG+0fvZX3QW9WIfFXe59CE95uB X-Gm-Gg: Acq92OH62DpKeDKJbX3LvUipKLoaQDdGz8zOMgwoq/3b3DmAcJqkD3IhM3wF/17tX5x VGLUR3LaDKiMsGnXUW8fWOyt4SsaZ9I0M/nlCYaDWcqWm5xDkpJaZ1H/2s1TZC7Kt5UAep9vKLq D9Cj6n+LXBdsD2Nj4aJB+ZDgAw53RyS8xSjUw1JTPZ/cZja+mNIOXS6jaZr6EaRkas+p+AjEXLh Gnr00iukLJnv5xKUtttwQDK2uBFpKq3cgDN8RQD+qpQYLU5HfXuaGSEa8DkutyxE/45VAiZhk0G K2oiGRBn2uFK+uu8AOPqlh3W2W1S8ZJfjuMnlMt/5R/6vkDl5Gzpi/djNoAGG+qr/KTjVAcl/eJ m98Upw57qC98v3Sw/x/f3G0torf1s31XmRbycJ29m6eQx08zTElXlpK+y2UHMyYlEYnCA X-Received: by 2002:a05:620a:262a:b0:914:c58f:a70f with SMTP id af79cd13be357-914c58faab0mr1672306685a.44.1779743213190; Mon, 25 May 2026 14:06:53 -0700 (PDT) MIME-Version: 1.0 References: <5835b04f-c53a-4f45-84a3-ea681f3fb338@eisentraut.org> In-Reply-To: <5835b04f-c53a-4f45-84a3-ea681f3fb338@eisentraut.org> From: Paul Ramsey Date: Mon, 25 May 2026 14:06:41 -0700 X-Gm-Features: AVHnY4LPxU20oLVcdnP0whWpvi7ed_1mgI6IiRjLObD6egN2WHZfQpU4SBcMP1I Message-ID: Subject: Re: Add --extra-dependencies and immediate data dumping for pg_dump/pg_upgrade To: Peter Eisentraut Cc: Jeevan Chalke , Matthias van de Meent , PostgreSQL Hackers , Regina Obe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 13, 2026 at 6:23=E2=80=AFAM Peter Eisentraut wrote: > > On 01.01.26 14:43, Jeevan Chalke wrote: > > Thanks for the feedback, Matthias; I agree with your assessment. > > Currently, Postgres lacks a native mechanism for tracking dependencies > > between a table and the specific rows of another table. While certain > > extensions like PostGIS introduce these patterns, they remain non- > > standard edge cases. > > > > Implementing a fix in the core backend seems like overkill for this > > scenario. Since the failure is specific to the upgrade path, targeting = | > > pg_dump| and |pg_upgrade| is a significantly less invasive approach. > > Notably, this patch triggers an immediate dump of the referenced table > > data -- an unconventional behavior that is better handled in the client > > binaries than in the backend. Consequently, this approach would require > > new options for these binaries to explicitly inject those dependency > > details. > > How about this: postgis should define its table spatial_ref_sys as > user_catalog_table, and we change pg_dump to dump the contents of user > catalog tables before other DDL. > > There is still some work to do here, but at least this sounds like a > more principled approach. I'm not 100% clear on why extensions are not restored first, in their entirety (functions, tables, data), before moving on to user table definition and user data. I have nothing against using user_catalog_table except that I am unsure of whether the other effects of that definition actually are good or not. In any event, spatial_ref_sys and its contents are already important and flagged as special, as a consequence of being a part of an extension. We already know they need special handling, even without flagging as user_catalog_table. P