RESTRICT / CASCADE

Started by Rod Taylorover 23 years ago4 messagesdocs
Jump to latest
#1Rod Taylor
rbt@rbt.ca

This note is currently in the 'Dependency Tracking (2.8)' section:

Note: According to the SQL standard, specifying either RESTRICT or
CASCADE is required. No database system actually implements it that way,
but the defaults might be different.

If the defaults are different, perhaps the documentation should show
it's examples using RESTRICT or CASCADE explicitly?

#2Rod Taylor
rbt@rbt.ca
In reply to: Rod Taylor (#1)
Re: RESTRICT / CASCADE

On Mon, 2002-09-09 at 14:40, Peter Eisentraut wrote:

Rod Taylor writes:

If the defaults are different, perhaps the documentation should show
it's examples using RESTRICT or CASCADE explicitly?

Also, in most examples the choice between RESTRICT and CASCADE would have
to be arbitrarily made by the documentation writer and might not be what
the user really wanted to do.

Good points. I suppose anyone paying enough attention to notice that
our behaviour restricts where others casacade will quickly realize what
they need to do.

--
Rod Taylor

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Rod Taylor (#1)
Re: RESTRICT / CASCADE

Rod Taylor writes:

If the defaults are different, perhaps the documentation should show
it's examples using RESTRICT or CASCADE explicitly?

Well, we're describing PostgreSQL, not other database systems that might
act differently.

I believe most SQL guides/books/courses/etc. simply use DROP TABLE name;
and this has also been historical practice in PostgreSQL, so we would
confuse users pretty heavily by adding RESTRICT or CASCADE everywhere.

Also, in most examples the choice between RESTRICT and CASCADE would have
to be arbitrarily made by the documentation writer and might not be what
the user really wanted to do.

--
Peter Eisentraut peter_e@gmx.net

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Rod Taylor (#1)
Re: RESTRICT / CASCADE

Rod Taylor <rbt@zort.ca> writes:

This note is currently in the 'Dependency Tracking (2.8)' section:
Note: According to the SQL standard, specifying either RESTRICT or
CASCADE is required. No database system actually implements it that way,
but the defaults might be different.

The note is perhaps not very well worded. No one actually requires you
to say RESTRICT or CASCADE, but there are some systems where the default
assumption is CASCADE. I think everyone here agrees that that's a
ridiculously dangerous default, so it's quite unlikely that PG's
behavior would ever vary from what it is now.

If the defaults are different, perhaps the documentation should show
it's examples using RESTRICT or CASCADE explicitly?

No, that's just pointless pedantry.

regards, tom lane