Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Limit record count


  • From: "Sean Z." <sean09182006(at)yahoo(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Limit record count
  • Date: Mon, 17 Dec 2007 14:02:57 -0800 (PST)
  • Message-id: <229478(dot)80511(dot)qm(at)web45105(dot)mail(dot)sp1(dot)yahoo(dot)com>

Hi,

I need to write a maintenance function to delete oldest records of a table, leaving only a certain number of records, say 50.  The task should run once per day.  How can I write it? 
The oldest record carries the smallest ID.

Thanks a lot!
Sean


Never miss a thing. Make Yahoo your homepage.

Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group