Обсуждение: Truncate width Postgres 7.3

Поиск
Список
Период
Сортировка

Truncate width Postgres 7.3

От
e.pellegrom@lectric.nl (eric)
Дата:
Hi,

A change in this version is:
"Disallow TRUNCATE on tables that are involved in referential
constraints (Rod)"

but i've a table witdh a many of referential constraints, what is now
the best way to empy a table?

thanx

Re: Truncate width Postgres 7.3

От
Bruno Wolff III
Дата:
On Thu, Jan 23, 2003 at 08:32:34 -0800,
  eric <e.pellegrom@lectric.nl> wrote:
> Hi,
>
> A change in this version is:
> "Disallow TRUNCATE on tables that are involved in referential
> constraints (Rod)"
>
> but i've a table witdh a many of referential constraints, what is now
> the best way to empy a table?

The simplest way is:
delete from table-name;

If you have a very large table this might be to slow.

Another option would be to drop the contraints and then truncate the
table.