Window Function References for PostgreSQL:

9.21. Window Functions

3.5. Window Functions

Putting Window Functions to Work

Writing a "fill-forward" view

Cumulative Sums

Calculating Changes in Values over Time

Add an auto-incrementing integer to a View

Trigger Functions

postgres update a date field when a boolean field is set to true