Re: equivalent of mysql's SET type?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: equivalent of mysql's SET type?
Дата
Msg-id AANLkTimW6UKACfRytE+CGXYnjnJkkNYkF7C35WuY3HqJ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: equivalent of mysql's SET type?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Manos Karpathiotakis
Дата:
Сообщение: Re: Maximum number of tables
Следующее
От: Vlad Romascanu
Дата:
Сообщение: converting E'C:\\something' to bytea