Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Truncate table ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3444 of 3596
Post > Topic >>

Truncate table at a certain size.

by dhuggard@[EMAIL PROTECTED] (Dana Huggard - Navarik) Apr 28, 2008 at 03:35 PM

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.




-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 3 Posts in Topic:
Truncate table at a certain size.
dhuggard@[EMAIL PROTECTED  2008-04-28 15:35:04 
Re: Truncate table at a certain size.
singh.gurjeet@[EMAIL PROT  2008-04-29 06:54:22 
Re: Truncate table at a certain size.
scott.marlowe@[EMAIL PROT  2008-04-28 21:31:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 5:07:56 CDT 2008.