Re: [SQL] delete with cascade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [SQL] delete with cascade
Date: 2001-05-04 22:24:09
Message-ID: 1698.989015049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin(at)bugs(dot)unl(dot)edu(dot)ar> writes:
> I was reading the manuals on DELETE and I saw this:
> By default DELETE will delete tuples in the table specified and all its
> sub-tables. If you wish to only update the specific table mentioned, you
> should use the ONLY clause.

> I just don't understand what sub-tables means.

It means inheritance children, ie, tables you created with INHERIT
from the specified table.

> Does it mean that it will
> delete rows on other tables which are referenced with a FOREIGN KEY to the
> row which will be deleted?

Foreign key deletion is an unrelated feature.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-05-04 22:27:38 Re: Daylight savings
Previous Message Tom Lane 2001-05-04 22:21:01 Re: semi-stupid question (index on OID)

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-05-04 22:43:40 Re: create table
Previous Message Bruce Momjian 2001-05-04 22:08:34 Re: Re: Use of the LIMIT clause ?