# Reset Counter

DevFeed: [Reset Counter](<https://devfeed.tech/articles/reset-counter-34477.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2012/10/reset-counter/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2012-10-05T07:44:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Sequences](<https://devfeed.tech/topics/sequences.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [blog](<https://devfeed.tech/tags/blog.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [sequences](<https://devfeed.tech/tags/sequences.md>), [window-functions](<https://devfeed.tech/tags/window-functions.md>)

## AI overview

A technical walkthrough for calculating the logical value of an ever-increasing counter that periodically resets. It models timestamped measurements and uses PostgreSQL window functions to identify counter wraparounds and retain the relevant values.

## Source excerpt

I've been given a nice puzzle that I think is a good blog article opportunity, as it involves some thinking and window functions.