﻿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
35362	ArrayField with nested CharField with a max_length silently truncates overlong values	Craig de Stigter	nobody	"With the following model

{{{
#!python
class TestModel(models.Model):
    arrayfield = ArrayField(
        models.CharField(max_length=63, blank=False), blank=False, null=False
    )

}}}

Saving an over-long string value into the arrayfield silently truncates the value:

{{{
#!python
>>> TestModel.objects.create(arrayfield=['a'*100])
<TestModel: TestModel object (1)>

>>> len(TestModel.objects.get().arrayfield[0])
63
}}}

This is probably because the `ArrayField` is casting its values (to `varchar(63)[]`) during queries for some reason. The [https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER postgres docs] suggest that casting to `varchar(X)` will truncate strings to X length.

This seems related to #33647 although it's not quite the same situation since this isn't `bulk_update`"	Bug	closed	Database layer (models, ORM)	dev	Normal	duplicate	postgres	Craig de Stigter	Accepted	0	0	0	0	0	0
