informatica:base_de_datos:postgresql:postgresql_json
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| informatica:base_de_datos:postgresql:postgresql_json [2026/01/24 22:26] – admin | informatica:base_de_datos:postgresql:postgresql_json [2026/02/12 01:10] (actual) – [Probar si un JSON valido] admin | ||
|---|---|---|---|
| Línea 3: | Línea 3: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| <code postgresql> | <code postgresql> | ||
| Línea 17: | Línea 28: | ||
| SELECT ' | SELECT ' | ||
| </ | </ | ||
| + | |||
| + | ===== Probar si un JSON es valido ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | <code postgresql> | ||
| + | CREATE OR REPLACE FUNCTION f_is_json(_txt text) | ||
| + | RETURNS bool | ||
| + | LANGUAGE plpgsql IMMUTABLE STRICT AS | ||
| + | $func$ | ||
| + | BEGIN | ||
| + | | ||
| + | EXCEPTION | ||
| + | WHEN SQLSTATE ' | ||
| + | RETURN false; | ||
| + | END | ||
| + | $func$; | ||
| + | |||
| + | COMMENT ON FUNCTION f_is_json(text) IS 'Test if input text is valid JSON. | ||
| + | Returns true, false, or NULL on NULL input.' | ||
| + | </ | ||
| + | |||
| + | |||
informatica/base_de_datos/postgresql/postgresql_json.1769293607.txt.gz · Última modificación: 2026/01/24 22:26 por admin
