informatica:base_de_datos:postgresql:postgresql_json
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| informatica:base_de_datos:postgresql:postgresql_json [2026/01/24 22:25] – creado admin | informatica:base_de_datos:postgresql:postgresql_json [2026/02/12 01:10] (actual) – [Probar si un JSON valido] admin | ||
|---|---|---|---|
| Línea 2: | Línea 2: | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | <code postgresql> | ||
| + | |||
| + | select * from | ||
| + | json_to_recordset( | ||
| + | ' | ||
| + | ) | ||
| + | as x(" | ||
| + | |||
| + | </ | ||
| + | |||
| + | <code postgresql> | ||
| + | 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.1769293531.txt.gz · Última modificación: 2026/01/24 22:25 por admin
