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.94.2) (envelope-from ) id 1tabr9-003S6L-6j for pgsql-general@arkaria.postgresql.org; Wed, 22 Jan 2025 14:37:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tabr7-000PJJ-9L for pgsql-general@arkaria.postgresql.org; Wed, 22 Jan 2025 14:37:21 +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.94.2) (envelope-from ) id 1tabr6-000PJA-Qq for pgsql-general@lists.postgresql.org; Wed, 22 Jan 2025 14:37:20 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tabr4-000vAh-28 for pgsql-general@lists.postgresql.org; Wed, 22 Jan 2025 14:37:19 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3eb790888c6so1784077b6e.2 for ; Wed, 22 Jan 2025 06:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737556638; x=1738161438; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ib01UBdt22QQIpn6YQtBJqXfZ1BUYHrFMnHQ/S8KH0I=; b=X3QXm6F/d/maLwI0XQIvPg41NrHASbMep3txdOrZvCNJVW5OC0dFOdCd56WwMThUw3 2F0vsHeYMgjQ6gAwfYDbRXl1IFZ6KUJg1iC32OmVPb1ePdnXHVl499o2I6gF04jVsMLE hgeCRSplQym6gKOQD966VTZkO1WXgauYGmdfLnGhmrXx/nzpRWkVDv3ImmA7yYuMEnL1 DLN/UZB+9bjQJsV2XwQa6/j0YHtu0zRLqUOhgZHxkyw6yaDW3Scnm71mU6j6OIbijeF+ xKnLYdY16RQ2HVi3LYrJwdoUy7ZSC7dA//wZaExZkTwctW9g7tPK9NLi0N5uqBNeoqdZ Hkxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737556638; x=1738161438; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ib01UBdt22QQIpn6YQtBJqXfZ1BUYHrFMnHQ/S8KH0I=; b=UZCSgGaYsXKlqGgI3W6pjlzU66EJffgVvmshfMDQVfJwtz3flGYbZqyWkf1l61UhbY 5Zhf45H8SUMspKfyyXtvc0Cf/zyQbM2d7Rd9NB4BZyCoUj26qK8TPDhyRZTS+FQHtYvk os4b95wwNO65ZydOe1qpjWLC+xjQVkxZZ1xOi0+WMOe8pwYiNGYUWjLdtoWTHcDZSXCE 4tn7qH5YJMeKHGLKj/XxXkDXSKHoz8Y+vQ0LJVCHJbFtq2+j5tmwIvmu5OPH9r0FeALr 5PUbjEY9cOOUeA4BPkANIpLInoJJrd3/l+CkLxCYrFx7sXgs+47NBbpKNOPsz8TqfHMT UqTw== X-Gm-Message-State: AOJu0YzUHU9BbhVYjQLPy+U0gy+W3GYL6/aRTPyXZ5O8jwD+w2EH34Ln s4ZG9IsLyZkrxtpPI7qcxZS4RkOILk0x/7YldkPv6j6e8knJU0LHA0woFZiljkhQArIud+u7iAh sYcc06uh2xGkL6ZpzXKxyH9vJAD4= X-Gm-Gg: ASbGncvVgFHoqInF+AcwAVXOOq+QVa5SVyXgr3xis8V5O7XizH1tUR/viLYoQ+B+w3h uC+MF9OUJJQuFPam7TWXIzDf2OWNuneOnM1iW9p/GAZyJkORFmac= X-Google-Smtp-Source: AGHT+IGcB9SGg8WFnGzSow73f+7uCXO2kSs7SwC6nqmg6ce51wm5D1jH5Hs2F8IUbZUl02+i0alRtgKHwz20QUpSpnY= X-Received: by 2002:a05:6808:4d08:b0:3eb:66a1:9d8f with SMTP id 5614622812f47-3f19fd4c7a0mr9970620b6e.25.1737556638496; Wed, 22 Jan 2025 06:37:18 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a8a:184e:0:b0:577:9519:f64a with HTTP; Wed, 22 Jan 2025 06:37:17 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 22 Jan 2025 07:37:17 -0700 X-Gm-Features: AbW1kvb6tV5WdR3l3EKH5pVQ6x-KQAWg3IpmH9aHjzN5d1taryjBCTGMP_LLJQk Message-ID: Subject: Re: Automatic deletion of orphaned rows To: Ron Johnson Cc: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000003701d3062c4c6e86" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003701d3062c4c6e86 Content-Type: text/plain; charset="UTF-8" On Wednesday, January 22, 2025, Ron Johnson wrote: > > >> I therefore propose a feature, to be able to specify in a table schema >> that a row should be deleted if orphaned. > > > For one thing, rows *can't* be orphaned if there's a foreign key > reference. > The description was correct even though using probably imprecise terminology. The basic goal is to delete childless parents. David J. --0000000000003701d3062c4c6e86 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, January 22, 2025, Ron Johnson <ronljohnsonjr@gmail.com> wrote:

I therefore propose a feature, to be able to specify in a table schema
that a row should be deleted if orphaned.

F= or one thing, rows can't=C2=A0be orphaned if there's a forei= gn key reference.=C2=A0

T= he description was correct even though using probably imprecise terminology= .=C2=A0 The basic goal is to delete childless parents.

=
David J.

--0000000000003701d3062c4c6e86--