Can't solve this problem

From: "Ivan Dolinin" <div(at)muma(dot)tusur(dot)ru>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Can't solve this problem
Date: 2002-07-25 06:33:29
Message-ID: NGBBKGFHKLAEEGPEFNBDCENJCAAA.div@muma.tusur.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Your name : Ruhl Anton
Your email address : rae(at)nikolas(dot)tomsk(dot)ru

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel P-III 733

Operating System (example: Linux 2.0.26 ELF) : Linux-2.2.19 RedHat

PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL 7.1 on
i686-pc-linux-gnu, compiled by GCC 2.96

Compiler used (example: gcc 2.95.2) : GCC 2.96

Please enter a FULL description of your problem:
------------------------------------------------

Several day ago we neew to clear some positions in the table bu SQL-script
starting the work by Cron. During the process we have found a problem we
can't solve. The problem is: not only corresponding the request positions
were deleted, the some positions not corresponding the request were deleted
also.

To make this request working is necessary:
delete from forum_data where interval_ge(interval '1 mon',
timestamp_mi(timestamp (now()), timestamp(date))) ='f';

We receive from PostreSQL "49 items were deleted" but all the entires from
the table were deleted. $9 - that is only our requested amount, that can be
any another.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

The problem is:
To make this request working is necessary:
delete from forum_data where interval_ge(interval '1 mon',
timestamp_mi(timestamp (now()), timestamp(date))) ='f';

We receive from PostreSQL "49 items were deleted" but all the entires from
the table were deleted. $9 - that is only our requested amount, that can be
any another.

The script controlled by Cron:

====== SQL Script ========
begin transaction;
select id, date from forum_data;

delete from forum_data where interval_ge(interval '1
mon',timestamp_mi(timestamp (now()), timestamp(date))) ='f';
select id, date from forum_data;
rollback;
select id, date from forum_data;
==========================

This is the processing table:
===== Describe test table =========
Table "forum_data"
Attribute | Type | Modifier
--------------+--------------------------+----------------------------------
-------------------
id | integer | not null default
nextval('forum_data_id_seq'::text)
section_id | integer | not null
parent_id | integer | not null
name | text |
date | timestamp with time zone | default "timestamp"(now())
text | text |
price | text |
contact_with | text |
autor | text |
send_email | boolean |
Index: forum_data_pkey
====================================

We can't solve this problem.

Thank you.

Anton Ruhl, Ivan Dolinin (Russia, Tomsk)

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-07-25 10:15:26 Bug #719: Restoring inherited data destroys parent table data.
Previous Message pgsql-bugs 2002-07-24 16:02:45 Bug #718: request for improvement of /? to show /d+ /l+ commands