pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feeddelete with cascade
3+ messages / 3 participants
[nested] [flat]
* delete with cascade
@ 2001-05-02 08:14 Martín Marqués <martin@bugs.unl.edu.ar>
0 siblings, 2 replies; 3+ messages in thread
From: Martín Marqués @ 2001-05-02 08:14 UTC (permalink / raw)
To: pgsql-sql; pgsql-general@postgresql.org
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. 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?
Saludos... :-)
--
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques | mmarques@unl.edu.ar
Programador, Administrador | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: delete with cascade
@ 2001-05-04 22:06 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Martín Marqués <martin@bugs.unl.edu.ar>
1 sibling, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2001-05-04 22:06 UTC (permalink / raw)
To: Martín Marqués <martin@bugs.unl.edu.ar>; +Cc: pgsql-sql; pgsql-general@postgresql.org
On Wed, 2 May 2001, [iso-8859-1] Martín Marqués wrote:
> 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.
Any table that inherit from this table.
> I just don't understand what sub-tables means. 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?
Only if you defined the foreign key with ON DELETE CASCADE.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] delete with cascade
@ 2001-05-04 22:24 Tom Lane <tgl@sss.pgh.pa.us>
parent: Martín Marqués <martin@bugs.unl.edu.ar>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2001-05-04 22:24 UTC (permalink / raw)
To: Martín Marqués <martin@bugs.unl.edu.ar>; +Cc: pgsql-sql; pgsql-general@postgresql.org
=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-05-04 22:24 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-02 08:14 delete with cascade Martín Marqués <martin@bugs.unl.edu.ar>
2001-05-04 22:06 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-05-04 22:24 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox