Re: jsonb and nested hstore
От | Alvaro Herrera |
---|---|
Тема | Re: jsonb and nested hstore |
Дата | |
Msg-id | 20140227010154.GK4759@eldon.alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: jsonb and nested hstore (Andres Freund <andres@2ndquadrant.com>) |
Список | pgsql-hackers |
Andres Freund wrote: > On 2014-02-26 16:23:12 -0500, Andrew Dunstan wrote: > > >>+ if (va->string.len == vb->string.len) > > >>+ { > > >>+ res = memcmp(va->string.val, vb->string.val, va->string.len); > > >>+ if (res == 0 && arg) > > >>+ *(bool *) arg = true; > > >Should be NULL, not 0. > > > > No, the compiler doesn't like that for int values. > > Yes, please disregard, I misread. I think I wanted actually to say that > the test for arg should be arg != NULL, because we don't usually do > pointer truth tests (which I personally find odd, but well). Pointer validity tests seem to be mostly a matter of personal preference. I know I sometimes use just "if (foo)" and other times "if (foo != NULL)". Both idioms are used inconsistently all over the place. We even have a PointerIsValid() macro. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: