Urgent.News

What's breaking now, across thousands of outlets.

Tech

PGHist | History and audit of table changes in PostgreSQL

Hello community! I have developed PGHist โ€” an open-source utility designed for saving, auditing, and viewing table change history in PostgreSQL. ๐ŸŽฏ Target audience: PGHist is specifically tailored for medium-sized projects and low-load tables within larger systems . Fully handles change auditing (log + temporal tables) but focuses primarily on displaying modifications to users. Setting up aโ€ฆ

PGHist is an open-source tool for tracking and viewing change history in PostgreSQL tables. It is designed for medium-sized projects and low-load tables, focusing on displaying modifications rather than logging them. The tool sets up statement-level triggers for INSERT, UPDATE, DELETE, and TRUNCATE operations, as well as stored procedures and views for data retrieval.

When a table is modified, triggers efficiently copy only the changed fields to the history schema. Special event triggers handle DDL operations like ALTER TABLE, automatically rebuilding the history tables and stored procedures. The storage structure is Transaction-Expression-Row, which minimizes redundancy and matches the database management system's operation.

To enable history tracking, users call pghist.hist_enable() on the target table. They can then view change logs by row, changes by field, or tables at a specific timestamp. The tool also allows defining SQL expressions for each table and column to describe changed rows and field values. By default, descriptions are created for foreign key fields and table rows.

PGHist supports inheritance, with stored procedures having a 'cascade' parameter to retrieve data with or without inheritance. It tracks modifications in a hierarchical manner (Change โ†’ Query โ†’ Transaction), allowing retrieval of all edits within a specific transaction or by a particular SQL statement. Optional conditions can be applied to the primary or foreign key when listing changes.

The tool has some limitations, such as not supporting updates to primary key values and potential issues when the table undergoes significant changes, requiring the history to be rebuilt. There is also a write overhead, as the tool captures changes using triggers and splits them dynamically across structured tables, resulting in roughly twice the write latency compared to standard operations.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

Python Queues: How At-Least-Once Delivery Impacts Reliability of Logistics User Reminders

Short answer: at-least-once delivery makes a reminder system safer against lost work, but it makes duplicate work an expected outcome.

  • At-least-once delivery increases reliability by preventing lost work in logistics reminders.
  • System treats queue as attempt, not confirmation, leading to duplicate delivery attempts.
  • Idempotency record and bounded storage improve latency vs. cost trade-off.

The Connected Vessel

A Blueprint for the Smart Boat of Tomorrow The car went from mechanical machine to connected computer in about two decades. Boats are starting the same journey.

  • Connected vessels integrate intelligence and communication onboard
  • Edge computing enables local intelligence operation
  • AI agents collaborate through shared data

Where can you get NVIDIA B300 GPUs by the hour?

You can get NVIDIA B300 GPUs by the hour, with no contract, from several platforms that publish a self-serve rate. Nodus lists the B300 at $6.943/hr on its pricing page, next to Modal at about $7.10โ€ฆ

  • NVIDIA B300 GPUs available for hourly rental
  • Hourly rates range from $6.943 to $9.50 per GPU
  • B300 is memory-intensive, ideal for memory-bound training jobs

Shan Shen Bu cat meme: 5 ways to make your own pet do the flash step

If your feed has a cat that stands up on two legs, freezes, lunges sideways and snaps back, then crouches into a back kick and stares at the camera, you have met the Shan Shen Bu cat meme.

  • Shan Shen Bu dance originated from 1990s folk dance tutorial
  • Five methods to create pet versions of the meme
  • Shan Shen Bu Cat & Dog AI tool specifically for pet memes

More from Saturday 7 November โ†’