Re: FW: Re: FW: Re: Shouldn;t this trigger be called?
От | Morris de Oryx |
---|---|
Тема | Re: FW: Re: FW: Re: Shouldn;t this trigger be called? |
Дата | |
Msg-id | CAKqnccjQUE5V-P+4BCg34UFoxq0=KNQLdQD+6qcr3ocn_wre=g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: FW: Re: FW: Re: Shouldn;t this trigger be called? (stan <stanb@panix.com>) |
Ответы |
Re: FW: Re: FW: Re: Shouldn;t this trigger be called?
|
Список | pgsql-general |
I see that you've already been pointed at citext, but I don't think a CHECK constraint has been mentioned. In case it hasn't, what about something like this?
ADD CONSTRAINT check_activity_status
CHECK (activity_status = 'ACTIVE' OR activity_status = 'INACTIVE');
I'm kind of allergic to ENUM...maybe that's just me. But since you're considering it, maybe it's the perfect time to consider all of your options. Such as a linked lookup table of defined allowed values (feels silly with two values), a domain (not entirely fit to purpose), or the CHECK constraint above. And, yeah, if it's only ever ACTIVE or INACTIVE, I'd normally make a Boolean named something like active, as Adrian Klaver mentioned. That's easy to reason about, and it makes it unambiguous that there are two and only two possible states..
В списке pgsql-general по дате отправления: