Can't solve this problem

Поиск
Список
Период
Сортировка
От Ivan Dolinin
Тема Can't solve this problem
Дата
Msg-id NGBBKGFHKLAEEGPEFNBDCENJCAAA.div@muma.tusur.ru
обсуждение исходный текст
Список pgsql-bugs
Your name        :    Ruhl Anton
Your email address    :    rae@nikolas.tomsk.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)

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Clive Deal
Дата:
Сообщение: Performance.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug #719: Restoring inherited data destroys parent table data.