Re: Proposal: TRUNCATE TABLE table RESTRICT
От | Don Baccus |
---|---|
Тема | Re: Proposal: TRUNCATE TABLE table RESTRICT |
Дата | |
Msg-id | 3.0.1.32.20000608064955.0115e270@mail.pacifier.com обсуждение исходный текст |
Ответ на | Proposal: TRUNCATE TABLE table RESTRICT (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Ответы |
Re: Proposal: TRUNCATE TABLE table RESTRICT
Re: Proposal: TRUNCATE TABLE table RESTRICT Re: Proposal: TRUNCATE TABLE table RESTRICT |
Список | pgsql-hackers |
At 09:24 PM 6/8/00 +0900, Tatsuo Ishii wrote: >It seems the truncate command deletes all rows from a table even it is >referenced by another tables. TRUNCATE is not in the standard any way, >so I would not claim this is a bug. However, sometimes it would be >helpful for a user to let him notice that the table about to be >truncated is referenced by some tables. So I would propose to add >"RESTRICT" option to the command. I mean if RESTRICT is specified, >TRUNCATE will fail if the table is referenced. Shouldn't it always fail if an explicit foreign key reference exists to the table, in much the way that delete of a referenced row does? If it doesn't now, I think it's a bug. If the references are implicit (no REFERENCE or FOREIGN KEY given to inform the db of the relationship) then a RESTRICT option to truncate does seem useful. - Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert Serviceand other goodies at http://donb.photo.net.
В списке pgsql-hackers по дате отправления: