PostgreSQL window function: serial # of event by day among many days
<p>I have this table with just one column of type datetime. And I have many events per day.</p>

<p>To get all the events it is just SELECT date FROM table;</p>

<p>How can I add a serial number to each row so that the first row in each day is 1, the second is 2, and so on, reseting the serial count on the next day?</p>

<p>I am looking for a solution using PostgreSQL window functions.</p>