2012-09-28 13 views

Antwort

45

an der Quelle der Suche nach PostgreSQL 9.2.1:

Source: postgresql-9.2.1\src\backend\utils\adt\json.c: 
/* 
* Input. 
*/ 
Datum 
json_in(PG_FUNCTION_ARGS) 
{ 
    char  *text = PG_GETARG_CSTRING(0); 

    json_validate_cstring(text); 

    /* Internal representation is the same as text, for now */ 
    PG_RETURN_TEXT_P(cstring_to_text(text)); 
} 

Update für PostgreSQL 9.3.5:

Der Code in der json_in Funktion geändert hat, aber die json interne Darstellung ist noch Text:

Source: postgresql-9.3.5\src\backend\utils\adt\json.c: 
/* 
* Input. 
*/ 
Datum 
json_in(PG_FUNCTION_ARGS) 
{ 
    char  *json = PG_GETARG_CSTRING(0); 
    text  *result = cstring_to_text(json); 
    JsonLexContext *lex; 

    /* validate it */ 
    lex = makeJsonLexContext(result, false); 
    pg_parse_json(lex, &nullSemAction); 

    /* Internal representation is the same as text, for now */ 
    PG_RETURN_TEXT_P(result); 
} 

so scheint es, dass für jetzt wenigstens, json ist das gleiche wie ein text Datentyp aber w mit JSON-Validierung. Die maximale Größe des Datentyps text ist 1GB.

+7

Verwendet der (neue seit Post?) Postgres 'jsonb'-Datentyp etwas anderes als reinen Text? –

+2

1GB! das ist ziemlich nett. Froh, dass die Nummer nicht in MB ist. – edencorbin

Verwandte Themen