Re: Add json_typeof() and json_is_*() functions.
От | Andrew Tipton |
---|---|
Тема | Re: Add json_typeof() and json_is_*() functions. |
Дата | |
Msg-id | CA+M2pVWjFYAtCpGSae3yJE7T+N6v288bSd=LoWXkvTLbCiNMWg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add json_typeof() and json_is_*() functions. (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Add json_typeof() and json_is_*() functions.
Re: Add json_typeof() and json_is_*() functions. |
Список | pgsql-hackers |
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 2, 2013 at 8:12 PM, Robert Haas <span dir="ltr"><<ahref="mailto:robertmhaas@gmail.com" target="_blank">robertmhaas@gmail.com</a>></span> wrote:<br /><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":7w5" style="overflow:hidden">+1,but I'm wondering why we need anything more than just<br /> json_typeof(). Doesn't that prettymuch cover it?</div></blockquote></div><br /></div><div class="gmail_extra">I agree with Merlin that json_is_object()is superfluous, since it can just be replaced with json_typeof() = 'object'. Likewise for json_is_array(). But without json_is_scalar(), the choice is one of these two forms:<br /></div><div class="gmail_extra"> json_typeof() NOT IN ('object', 'array')<br /></div><div class="gmail_extra"> json_typeof() IN ('string','number', 'boolean', 'null')<br /><br /></div><div class="gmail_extra">And it protects the user against forgettingabout, say, the 'null' typeof() when constructing their check expression.<br /><br /><br /></div><div class="gmail_extra">Regards,<br/>Andrew Tipton<br /></div></div>
В списке pgsql-hackers по дате отправления: