remove dead code
authorAndrew Dunstan <[email protected]>
Tue, 18 Mar 2014 16:10:22 +0000 (12:10 -0400)
committerAndrew Dunstan <[email protected]>
Tue, 18 Mar 2014 16:10:22 +0000 (12:10 -0400)
src/backend/utils/adt/jsonfuncs.c

index c87ddc5d0518a4cae9502f26d2cc0968705a513e..a5a7a37dca3f441805f56128247a8dd95b0fc016 100644 (file)
@@ -740,7 +740,6 @@ json_extract_path_text(PG_FUNCTION_ARGS)
 static inline Datum
 get_path_all(FunctionCallInfo fcinfo, bool as_text)
 {
-   Oid         val_type = get_fn_expr_argtype(fcinfo->flinfo, 0);
    text       *json;
    ArrayType  *path = PG_GETARG_ARRAYTYPE_P(1);
    text       *result;
@@ -753,18 +752,7 @@ get_path_all(FunctionCallInfo fcinfo, bool as_text)
    long        ind;
    char       *endptr;
 
-   Assert(val_type == JSONOID || val_type == JSONBOID);
-   if (val_type == JSONOID)
-   {
-       /* just get the text */
-       json = PG_GETARG_TEXT_P(0);
-   }
-   else
-   {
-       Jsonb      *jb = PG_GETARG_JSONB(0);
-
-       json = cstring_to_text(JsonbToCString(NULL, VARDATA(jb), VARSIZE(jb)));
-   }
+   json = PG_GETARG_TEXT_P(0);
 
    if (array_contains_nulls(path))
        ereport(ERROR,
@@ -804,17 +792,10 @@ get_path_all(FunctionCallInfo fcinfo, bool as_text)
    result = get_worker(json, NULL, -1, tpath, ipath, npath, as_text);
 
    if (result != NULL)
-   {
-       if (val_type == JSONOID || as_text)
            PG_RETURN_TEXT_P(result);
-       else
-           PG_RETURN_JSONB(DirectFunctionCall1(jsonb_in, CStringGetDatum(text_to_cstring(result))));
-   }
    else
-   {
        /* null is NULL, regardless */
        PG_RETURN_NULL();
-   }
 }
 
 /*