On Thu, Mar 10, 2011 at 3:54 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
> On Thu, Mar 10, 2011 at 3:21 PM, Reece Hart <reece@harts.net> wrote:
>> On Wed, Mar 9, 2011 at 9:16 AM, Merlin Moncure <mmoncure@gmail.com> wrote:
>>>
>>> create type validation_flags as
>>> (
>>> cluster bool,
>>> freq bool
>>> );
>>
>> Wow. That solution is nearly sexy, and far and away better than any solution
>> that I would have come up with. Thanks, Merlin!
>
> thanks -- I do what I do. fyi another thing is this only works if no
> flags substrings of other flag -- no big deal to add a little guard
> against that in the 'in' function though if you need to.
> also one pain point with composite types is that you can't flip
> specific fields like this:
>
> update foo set (flags).freq = true;
Actually you *can* do this -- I just didn't know it.
update foo set flags.freq = true;
will work, so all that extra stuff to do that isn't needed.
merlin