Обсуждение: Insert statement deletes older table records

Поиск
Список
Период
Сортировка

Insert statement deletes older table records

От
Rabi Jay
Дата:
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.
 
Thanks.

Re: Insert statement deletes older table records

От
Scott Marlowe
Дата:
On Sun, May 29, 2011 at 6:07 PM, Rabi Jay <rabijay1@yahoo.com> wrote:
> 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.

This is not normal behaviour.  Can you post a self-contained example
of this behaviour?

Re: Insert statement deletes older table records

От
Cédric Villemain
Дата:
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

Re: Insert statement deletes older table records

От
Simon Riggs
Дата:
On Mon, May 30, 2011 at 1:07 AM, Rabi Jay <rabijay1@yahoo.com> wrote:

> 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.

If this is a real report, please come back with further details of the
actions you are performing, version numbers and related details. If
what you say is correct then this is a data loss bug and this project
takes such things very seriously.

Having said that, this is the second time in last few months that some
"hearsay" has emerged relating to there being a limit on the number of
rows in a PostgreSQL database. So I'm a little skeptical as to this as
a credible bug report.

PostgreSQL has never had a bug filed of this nature. The described
behaviour would certainly have been picked up in testing or production
usage if it was a bug, especially since tables with 1 billion+ rows in
are fairly common.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services