# \[IGN-6111\] Delete records via transaction group

**URL:** <https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397>\
**Category:** Ignition\
**Created:** [May 10, 2022, 11:16am UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397 "2022-05-10T11:16:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andreas/32/18981_2.png) [@andreas](https://forum.inductiveautomation.com/u/andreas)\
**Post date:** [May 10, 2022, 11:16am UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/1 "2022-05-10T11:16:29Z")

</div>

Hi,

While experimenting with the “Delete records older than:” option in a transaction group, I noticed that all current rows were deleted (even if multiple rows were not older than the option) in the database table if I via script console inserted a new row with an old timestamp.

For testing, I used the following configuration:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/c/5c6a327d603c20a846bc57524684e368b2a90c2f.png)

These value were inserted by the transaction group (on a value change trigger):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/31f29df6efd910edecac542715705220c9e0eff5.png)

30 seconds later I inserted a new row via the script console (system.db.runPrepUpdate), with a t\_stamp from yesterday:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d904742ed384b9f97403faa5e14ba5cd8f60403.png)

Couple of seconds later, even if three of the t\_stamps were “inside” the delete option, all the rows were deleted from the table:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f2d984d3aa1669aa78cc72ba3fc8fb5a76a32ea1.png)

It seems to be happening if I insert a new row in the table with a t\_stamp outside the delete option, and has a higher row index.

Seems strange that it deletes all rows, even if many of them are inside the “time limit” of the transaction group 🤔

Is this normal behaviour? Anyone else experienced this, and knows how to avoid it (besides disabling the option of deleting records older than…)?

Tested on ubuntu (v. 8.1.16) and windows (v. 8.1.11).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 10, 2022, 11:54am UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/2 "2022-05-10T11:54:07Z")

</div>

Oy! Sounds like a bug. You should report this to support.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 10, 2022, 12:23pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/3 "2022-05-10T12:23:16Z")

</div>

I just tried this on Windows 10, Ignition 8.1.17 RC1, and PostgreSQL DB…  
And it works as it should… 🤔

---

<div class="post-metadata">

**Author:** ![andreas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andreas/32/18981_2.png) [@andreas](https://forum.inductiveautomation.com/u/andreas)\
**Post date:** [May 10, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/4 "2022-05-10T13:10:56Z")

</div>

Just tried my scenario with PostgreSQL also, the same thing happens there… 🤔

Can you post an image of your transaction group configuration, so that I can try the same setup? 🙂

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 10, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/5 "2022-05-10T13:39:58Z")

</div>

> [@andreas](#):
>
> ...if I via script console inserted a new row with an old timestamp.

I'm inclined to think it's a bug, but what you're doing is also outside the normal usage of a transaction group. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![andreas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andreas/32/18981_2.png) [@andreas](https://forum.inductiveautomation.com/u/andreas)\
**Post date:** [May 10, 2022, 1:57pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/6 "2022-05-10T13:57:26Z")

</div>

Agree that it may not be the normal usage of a transaction group, but I am glad I did not experience this on a large table with thousands of rows resulting in the loss of a large amount of data 🙂  
Maybe there should be some kind of logic preventing this from happening. If there is no such thing already existing, that I’m not aware of? 🤔

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 10, 2022, 6:34pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/7 "2022-05-10T18:34:56Z")

</div>

Any chance you have another group somewhere pointing at the same table?

---

<div class="post-metadata">

**Author:** ![andreas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andreas/32/18981_2.png) [@andreas](https://forum.inductiveautomation.com/u/andreas)\
**Post date:** [May 10, 2022, 7:22pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/8 "2022-05-10T19:22:11Z")

</div>

No chance 🙂

Have tried creating new "custom" tables, tried adjusting the "delete records older than:" setting to larger values (hours, days etc.), tried adjusting the transaction group trigger settings, the issue still happens..

I have created a support ticket, and the first response from support is:

> What you're seeing here is a known bug related to internal timestamp comparisons. Notice that if you start with a brand new table, the issue will still happen, and it happens every 60 seconds. The issue relates to timezones, so I think the logic behind the scenes will cause some issues.

The support team further says that an internal bug ticket has been created so that the developers may prioritize it. Development is also being asked to verify the conditions required for this issue and potentially escalate this if it poses a risk to large table data.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 11, 2022, 7:07am UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/9 "2022-05-11T07:07:54Z")

</div>

Sorry, but I was too quick…  
You’re right, it’s deleting all rows…  
This is what I found in the PostgreSQL log file:

```auto
2022-05-11 08:47:59.635 CEST [6384] LOG: execute <unnamed>: SELECT CURRENT_TIMESTAMP
2022-05-11 08:47:59.637 CEST [6384] LOG: execute S_11: SELECT max("testtable_ndx") FROM testtable WHERE "t_stamp"<$1
2022-05-11 08:47:59.637 CEST [6384] DETAIL: parameters: $1 = '2022-05-11 08:42:59.635'
2022-05-11 08:47:59.638 CEST [6384] LOG: execute S_16: DELETE FROM testtable WHERE "testtable_ndx"<=$1
2022-05-11 08:47:59.638 CEST [6384] DETAIL: parameters: $1 = '20'

```

It is deleted based on the index…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 11, 2022, 11:24am UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/10 "2022-05-11T11:24:09Z")

</div>

> [@zxcslo](#):
>
> It is deleted based on the index…

Oy! That's just evil.

---

<div class="post-metadata">

**Author:** ![jhansen](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jhansen](https://forum.inductiveautomation.com/u/jhansen)\
**Post date:** [July 14, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/11 "2022-07-14T13:39:15Z")

</div>

Hi all,

FYI this issue is fixed in Ignition 8.1.19. Check out the [changelog](https://docs.inductiveautomation.com/display/DOC81/New+in+this+Version) for that version when it’s released!

---

<div class="post-metadata">

**Author:** ![kens](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kens](https://forum.inductiveautomation.com/u/kens)\
**Post date:** [January 7, 2026, 5:03pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/12 "2026-01-07T17:03:55Z")

</div>

Hate to be the bearer of bad news, but this bug is still occurring on Ignition 8.1.50.

I’m running the Core Certification Gateway Project.

1. Restore Gateway from Backup
2. Create New Historical Transaction Group in SiteA project.
3. Name the table, e.g., ‘myTable’
4. Add tags (I used Ramp0..Ramp9)
5. [x] Delete Records older than: [1] [minute(s)]
6. Enable Transaction Group
7. Save Project
8. Open DB Query Browser
9. Add SELECT \* FROM myTable
10. Execute
11. Enable Auto Refresh

Every 60s, all records are deleted.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 12, 2026, 4:52pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/13 "2026-01-12T16:52:40Z")

</div>

You should contact [support](https://support.inductiveautomation.com) officially to get a proper bug report going.

---

<div class="post-metadata">

**Author:** ![kens](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kens](https://forum.inductiveautomation.com/u/kens)\
**Post date:** [January 12, 2026, 6:47pm UTC](https://forum.inductiveautomation.com/t/ign-6111-delete-records-via-transaction-group/59397/14 "2026-01-12T18:47:34Z")

</div>

Quick follow up – after discussing with Support, the ‘delete older than’ bug occurs only when using SQLite, since that doesn’t support datatypes on columns. It works normally in MySQL (and I assume other databases)
