feature idea – automatic update tracking using date fields – feedback pls

Поиск
Список
Период
Сортировка
От anony@dslextreme.com (anony)
Тема feature idea – automatic update tracking using date fields – feedback pls
Дата
Msg-id b6eacd5.0405202154.6855f913@posting.google.com
обсуждение исходный текст
Ответы Re: feature idea – automatic up  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Maybe this feature is already out there.
I guess you could write triggers to do some of this.

Often when designing a database I add a start_date and end_date column
to the table. The start_date is when the record was created and the
end_date is when the record expired. For UPDATES, I populate the
end_date and INSERT a new record. This allows you to track changes
though out time.

I do this so often I thought it would be a good idea for each table to
have the option for automatic UPDATE tracking. When the UPDATE occurs
the old record is automatically saved with the end_date populated. The
old records would not be visible unless explicitly queried using date
fields.

Advantages
----------------
Less Coding: Now I don't have update the old record's end_date and
insert a new record for a simple update. A simple UPDATE will take
care of it.

Good Form: Keeping history of all the changes is important in many
applications

Easier Queries: If this feature was implemented, multiple tables joins
could possibly be referenced by one condition in the WHERE clause,
rather than multiple conditions for each table in the join.

My .02
Feedback Please.

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Porting SQL Server 2000 database to PostgreSQL
Следующее
От: anony@dslextreme.com (anony)
Дата:
Сообщение: Re: Porting SQL Server 2000 database to PostgreSQL