django-debug-toolbar icon indicating copy to clipboard operation
django-debug-toolbar copied to clipboard

Cannot analyze/select queries with Postgres arrays in params

Open frgtn opened this issue 10 years ago • 3 comments

DjDT currently doesn't support PostgreSQL Array syntax and returns 500 when trying to analyze or reselect queries that contain Postgres arrays in params.

From the looks of it DjDT query tracker assumes no nested values when serializing query params. The error occurs when these incorrectly serialized params are fed into the cursor.

frgtn avatar Sep 04 '15 12:09 frgtn

The toolbar also doesn't support queries with contains or contained_by on a HStoreField and any of the RangeFields.

tim-schilling avatar Oct 03 '15 14:10 tim-schilling

@aaugustin Do you know if there was a reason why we chose to create our own _decode rather than pickling the params? I'm thinking we may want to convert to pickling the params since the range fields need to have the actual class instance passed as the parameter.

Right now the toolbar is decoding a parameter of (NumericRange(0, 999999, '[)'),) to be '["NumericRange(0, 999999, \'[)\')"]' which when the form cleans and outputs the parameters it becomes "NumericRange(0, 999999, \'[)\')"

tim-schilling avatar Oct 03 '15 14:10 tim-schilling

I don't know. If you have an idea to fix the problem, please go ahead :-)

aaugustin avatar Nov 20 '15 12:11 aaugustin