Hi,
I've got a log-table that records events regarding other objects.
Those events have a state that shows the progress of further work on
this event.
They can be open, accepted or rejected.
I don't want to be able to insert addition events regarding an object X
as long there is an open or
Andreas maps...@gmx.net wrote:
Hi,
I've got a log-table that records events regarding other objects.
Those events have a state that shows the progress of further work on
this event.
They can be open, accepted or rejected.
I don't want to be able to insert addition events regarding an
Andreas Kretschmer akretsch...@spamfence.net wrote:
Andreas maps...@gmx.net wrote:
Hi,
I've got a log-table that records events regarding other objects.
Those events have a state that shows the progress of further work on
this event.
They can be open, accepted or rejected.
I
On Wed, Jul 11, 2012 at 12:50 AM, Andreas maps...@gmx.net wrote:
[...]
I can't simply move rejected events in an archive table and keep a unique
index on object_id as there are other descriptive tables that reference the
event_log.id.
Would a multi-column index, unique on (id, state) meet
Or this one:
test=*# create unique index on log((case when state = 0 then 0 when
state = 1 then 1 else null end));
CREATE INDEX
Now you can insert one '0' and one '1' - value - but no more.
Hi,
A partial index would do the same, but requires less space:
create unique index on
Marc Mamin m.ma...@intershop.de wrote:
Or this one:
test=*# create unique index on log((case when state = 0 then 0 when
state = 1 then 1 else null end));
CREATE INDEX
Now you can insert one '0' and one '1' - value - but no more.
Hi,
A partial index would do the same,