cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How purge old data in data base or how count the number of tuples inside the data base

dbologna
12-Amethyst

How purge old data in data base or how count the number of tuples inside the data base

How do I purge data in the PostGreSQL database using retention, how do I calculate the number of tuples in the PostgreSQL database. In Thingworx version 8.5, the OA_OpertorAdviso-extension existed, which provided the PurgeOldProperties service and the GetVSTuples() service. Does something similar exist in Thingworx Version 9.6? Where can I find it?

BR

Dimitri

3 REPLIES 3
wcui
16-Pearl
(To:dbologna)

I am afraid no such extension(not retention) exist for ThingWorx 9.x.

Please refer to PostgreSQL guide and find the corresponding SQL statements.

You can run those statements from ThingWorx by using a Database thing.

For example, below SQL returns dead and live tuples for each database table.

    select n_live_tup, n_dead_tup, relname from pg_stat_all_tables order by relname

 

For how to use a Database thing inThingWorx, please refer to below article.

https://www.ptc.com/en/support/article/CS318728

 

Bikash_Panda
13-Aquamarine
(To:dbologna)

To implement retention, you might implement a database Thing, which might take a date or relative time like days or month, and removes data from DB older then that.

wcui
16-Pearl
(To:dbologna)

Hi @dbologna ,

It appears that a response to this post answers your question.  For the benefit of other Community Members who may have the same question, it would be great if you could designate the proper one as the Accepted Solution.

In the event that this response did not answer your question, please post your current status so that we can continue to support.

Thanks for using the PTC Community!

Regards,

wcui

Announcements


Top Tags