Search Postgresql Archives

Immutable datastore library?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like to use Postgres as an immutable data store. A subject table would have a timestamp column, and that would be added to what would otherwise be the primary key.

Trap updates and turn them into inserts. Have an associated _deleted table. Trap deletes and turn them into inserts of the primary key into that table.

Create a view that only shows the non-deleted records with the most recent timestamps.

Stored procedure to do all that to a table. Event trigger to drop and re-create the view on changes to the table columns.

I think that's about it. Seems an obvious and nice general-purpose thing to do. It also seems like something someone might have already done, but googling "immutable postgres" pulls up things about writing functions.

Does anyone know of a project that has already done this?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux