Re: [PATCH] Generalized JSON output functions

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, hlinnaka <hlinnaka(at)iki(dot)fi>, Ryan Pedela <rpedela(at)datalanche(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH] Generalized JSON output functions
Date: 2015-07-17 15:15:46
Message-ID: 20150717151546.GS2301@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shulgin, Oleksandr wrote:
> On Jul 17, 2015 4:31 PM, "Andrew Dunstan" <andrew(at)dunslane(dot)net> wrote:

> > Incidentally, this doesn't look acceptable anyway:
> >>
> >> ! es->json_cxt.value(&es->json_cxt, num, JSONTYPE_NUMERIC,
> >> ! NUMERICOID, 1702 /* numeric_out */);
> >
> > We don't hardcode function oids elsewhere. So this is also something that
> > makes the patch unacceptable.
>
> Well, good to know (I believe I've asked about this in the first mail
> specifically).
>
> Is there any way a built-in function oid would change/differ on different
> server versions? What would be the recommended way to do this?

C'mon, that's a trivial problem. Just use getTypeOutputInfo();
numeric's OID is hardcoded as NUMERICOID.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2015-07-17 16:46:15 Re: [PATCH] Generalized JSON output functions
Previous Message Petr Jelinek 2015-07-17 15:13:57 Re: TABLESAMPLE patch is really in pretty sad shape