From: Dana Huggard - Navarik <dhuggard@navarik.com>
To: pgsql-sql@postgresql.org
Subject: Truncate table at a certain size.
Date: Mon, 28 Apr 2008 15:35:04 -0700
Message-ID: <1209422104.12712.12.camel@H-S12.internal.navarik.com> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dhuggard@navarik.com
Subject: Re: Truncate table at a certain size.
In-Reply-To: <1209422104.12712.12.camel@H-S12.internal.navarik.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox