﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36832	Django DB connection returns incorrect type for JSON objects with a top-level list	Christophe Pettus	Christophe Pettus	"Test case here: https://github.com/Xof/django_test_str

Back to at least Django 4.0, there is a bug in the database interface under
specific conditions:

1. PostgreSQL.
2. The cursor is created from the `django.connection` object.
3. The data type being returned is JSON.
4. The top-level structure in the JSON blog is a list, rather than an object.

In that situation, `cursor.execute` returns a `str` rather than a Python `list`.
This bug does not exist if the query is executed using `psycopg2` directly.

This test case should be self-contained, although you do need a local PostgreSQL
database. The only dependency besides Django is `psycopg2`.

To run the test, use:

{{{
./manage.py test --keepdb
}}}

(`--keepdb` is not strictly required, but it avoids some unrelated errors.)
"	Bug	closed	Database layer (models, ORM)	6.0	Normal	duplicate		Christophe Pettus	Unreviewed	0	0	0	0	0	0
