View JSON stored in a database without losing context

By Anil Gautam · September 20, 2026

Start with one row when inspecting JSON in a database. Check the column type, then look at the stored value. A formatted preview is easier to read, but you still need to know whether you’re looking at JSON, text containing JSON or a value encoded twice.

Inspect one known record

Keep the row ID next to the JSON so you know which record you’re reading. This PostgreSQL example selects one event:

SELECT id, payload
FROM public.events
WHERE id = 42;

Replace the table and column names with your schema. Do not export an entire event table simply to inspect one field. If the value contains personal data or tokens, keep it in an approved local tool.

Check the values, not just the formatting

Indentation improves readability but does not establish that the value follows your application’s schema. A missing property differs from a property explicitly set to null. A JSON string containing digits differs from a number. An empty array differs from an empty object.

If the viewer shows backslashes and outer quotes, inspect the column type and actual stored value before removing escapes. Those characters may belong to a string representation, an export format, or a second encoding layer. Blind replacement can corrupt valid content.

Choosing a viewer

DBeaver documents its XML and JSON viewing workflow. Check the controls available in your installed edition. For plainDB, evaluate the displayed value and export behavior with a representative record; do not assume a dedicated JSON tree editor or JSON-schema validator from its general data-grid support.

Export and compare carefully

Choose an export format based on the next consumer. A JSON column inside a CSV cell needs CSV quoting as well as valid JSON content. Test a small export by reading it back with the intended application and comparing identifiers, nulls and nested values.

plainDB can export query results in supported formats, but an export contains the fetched result rather than a guaranteed full-table backup. See the feature matrix and NULL versus empty-string guide for related pitfalls.