Re: "truncate all"?

Поиск
Список
Период
Сортировка
От Andreas
Тема Re: "truncate all"?
Дата
Msg-id 5.2.0.9.0.20030805100722.00b4beb8@pop.chello.at
обсуждение исходный текст
Ответ на "truncate all"?  (Andreas <e9625203@student.tuwien.ac.at>)
Ответы Re: "truncate all"?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: "truncate all"?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Hi there,
> I agree with Tom ... even the idea of a "TRUNCATE ALL" makes me nervous.  If> we had such a feature, I'd advocate
thatit be superuser only.
 

This "superuser only" restriction certainly would be sensible.
> As for "TRUNCATE CASCADE" or similar improvements, I agree that they 
could be> convenient ... but are easily worked around currently.

Agreed, workarounds are easy. The original suggestion of "TRUNCATE ALL"
(or "TRUNCATE table CASCADE"), however, was motivated by the search for a
simple and efficient truncation of all tables to accelerate unit-testing.
Obviously, a plain "TRUNCATE" without arguments that truncates all tables
would be dangerous, and in order to stay consistent with current psql
syntax, I would say that an efficient "TRUNCATE table [CASCADE|RESTRICT]",
with the "RESTRICT" option being the default, would be totally sufficient
to satisfy the original motivation.

Another way to specify a safe but efficient "TRUNCATE ALL" command that
might be easier to implement than above "TRUNCATE table
[CASCADE|RESTRICT]"  might be to implement the functionality of the
originally suggested "TRUNCATE ALL" through a psql meta-command. Any
suggestions for a safe syntax of such a "TRUNCATE ALL" meta-command? How
about "\rtuples *"?
>   So I wouldn't object to putting TRUNCATE CASCADE on the todo list, but> would argue that it be left to the people
whoasked for it to implement> it.
 

Before attempting to implementing any such extension, we would like to
make sure that that extension would not be rejected by those of you who
decide what goes into future versions of postgresql.
    Yours,        Andi.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: DROP TYPE/DROP DOMAIN
Следующее
От: "Jinqiang Han"
Дата:
Сообщение: win32 porting in 7.4