title: Timezone aware uniqueness constraint
body: <p>I am working with a timesheet app, used by users from multiple timezones. I am trying to introduce a unique constraint, that only allows users to <code>clock_in</code> or <code>clock_out</code> once per day in the local timezone.</p>
  <p>Please refer to the following table declaration:</p>
  <pre class="lang-sql prettyprint-override"><code>Table &quot;public.entries&quot;
  ---------------------------------------------
    Column   |              Type              |
  ---------------------------------------------
  id         | bigint                         |
  user_id    | bigint                         |
  entry_type | string                         | enum(clock_in, clock_out)
  created_at | timestamp(6) without time zone |
  </code></pre>
  <p>But little lost on how to handle the timezone-aware uniqueness.</p>
  <p>Update:</p>
  <ul>
  <li>I am considering 0:00 hrs to 23:55 hrs of local time zone as day.</li>
  <li>User's timezone is stored in the <code>users</code> table but can move to the <code>entries</code> table if it helps with constraints.</li>
  </ul>