Re: 'UNIQUE'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ben Clewett <B(dot)Clewett(at)roadrunner(dot)uk(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: 'UNIQUE'
Date: 2003-03-17 14:51:45
Message-ID: 6083.1047912705@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ben Clewett <B(dot)Clewett(at)roadrunner(dot)uk(dot)com> writes:
> Does 'UNIQUE' allow multiple 'NULL' entries?

Yes; this is per SQL spec.

> But I am wondering if PostgreSQL
> stores the last write timestamp to a table somewhere where it can be
> checked easily?

No --- Postgres doesn't keep track of that at all.

For the particular situation you are describing, I don't think you
really want timestamps per se. What you want is a trigger that will
send a NOTIFY message when the table changes. Apps with dependent state
(like combobox entries) can LISTEN for this message and then rebuild
their local state when they get it. This is much more efficient than
putting a timestamp someplace, because the recipients don't have to
waste cycles probing to find out if there's been an update.

regards, tom lane

In response to

  • 'UNIQUE' at 2003-03-17 14:33:41 from Ben Clewett

Browse pgsql-novice by date

  From Date Subject
Next Message Sugrue, Sean 2003-03-17 16:39:53 perl and postgresql
Previous Message Ben Clewett 2003-03-17 14:33:41 'UNIQUE'