Re: Insert statement deletes older table records - Mailing list pgsql-admin

From Cédric Villemain
Subject Re: Insert statement deletes older table records
Date
Msg-id BANLkTik=Jsb-4Dr2qu6tEKi89Cosh0qUMg@mail.gmail.com
Whole thread Raw
In response to Insert statement deletes older table records  (Rabi Jay <rabijay1@yahoo.com>)
List pgsql-admin
2011/5/30 Rabi Jay <rabijay1@yahoo.com>:
> Hi,
>
> When I execute an insert statement, older table records are deleted even
> though my insert statement works. It always keeps the maximum number of
> records in the table to 4200 records. So If I added 3 more records, it
> deletes the first three records in the table even though it adds the 3 new
> records.
>
> Based on my research it appears postgreql has no limit to number of records
> in a table - what should I do to avoid this behavior.

I think your can look at the PostgreSQL 9.1 (still in beta).
Cf doc for writable CTE :
http://www.postgresql.org/docs/9.1/static/queries-with.html
 7.8.2. Data-Modifying Statements in WITH

And delete/insert in the same query.

Else there is no special feature to limit the number of rows in a table

>
> Thanks.



--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

pgsql-admin by date:

Previous
From: Tomasz Chmielewski
Date:
Subject: Re: 'SGT DETAIL: Could not open file "pg_clog/05DC": No such file or directory' - what to do now?
Next
From: Tom Lane
Date:
Subject: Re: 'SGT DETAIL: Could not open file "pg_clog/05DC": No such file or directory' - what to do now?