Truncate table at a certain size.

Поиск
Список
Период
Сортировка
От Dana Huggard - Navarik
Тема Truncate table at a certain size.
Дата
Msg-id 1209422104.12712.12.camel@H-S12.internal.navarik.com
обсуждение исходный текст
Ответы Re: Truncate table at a certain size.  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Список pgsql-sql
Hello,

What would be the best method to truncate a table once it reaches a
certain size.   

For instance, a table named log.  I can check the size of the log;
  db=# select pg_relation_size('log');  pg_relation_size   ------------------                8192  (1 row)


What I would like to do is 

If table log, is greater than xxxx bytes  then truncate table log


Maybe I'll dump it to a flat file first, (yes, it should really be a
flat file to start with, and not in a db.)

Thank you.





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

Предыдущее
От: "Nacef LABIDI"
Дата:
Сообщение: currval of sequence "my_seq" is not yet defined in this session
Следующее
От: Tom Lane
Дата:
Сообщение: Re: information_schema.referential_constraints permissions