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

Replacing old tuples on insert

From: Pradeep Kumar <pradeeppj(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Replacing old tuples on insert
Date: 2004-11-24 05:30:35
Message-ID: d7de9af604112321307d378e19@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi all,

I have not subscribed to this list. However I have registered to the
list with another id of mine which is not working right now.

I have a table as follows - 
table TrendData( TrendID bigserial,
                         TrendName varchar(30),
                         .....
                         .....);

Now for this table i want a maximum of only 5000 tuples. After the
maximum is reached the new tuples that are inserted should replace the
older ones. Could anyone help me out in writing the query or a trigger
also would be fine.

Thanx and Regards,
Pradeep

pgsql-novice by date

Next:From: ravi shankarDate: 2004-11-24 06:41:04
Subject: Dumping Postgresql 7.4.2 database file into Postgresql 7.1.3 or 7.3 or 7.2 databases
Previous:From: Tom LaneDate: 2004-11-23 21:59:03
Subject: Re: difference between not null and <> null

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group