Marc Mamin 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,
>
> 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 Wed, Jul 11, 2012 at 12:50 AM, Andreas 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 your need?
rls
Andreas Kretschmer wrote:
> Andreas 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
Andreas 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 object X
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 a