﻿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
36466	Relax check E042 preventing including stored generated fields in composite primary keys	David Sanders	David Sanders	"Currently E042 prevents including `GeneratedField` in a `CompositePrimaryKey`.

Postgres & MySQL are both fine with including stored generated columns in primary keys, including when foreign keys reference these pks.  Postgres (18) & MySQL both reject the inclusion of virtual generated columns.

SQLite doesn't allow generated columns altogether: https://www.sqlite.org/gencol.html#limitations

I don't have an Oracle instance to test with.

Django should not get in the way of a valid database operations for vendors that do support a feature. I realise that `--skip-checks` can be passed in but then we'd be bypassing other useful checks for the lifetime of a codebase.

Personally I believe we should remove the generated columns part of E042 altogether as the user will find out the mistake soon enough when the database complains during migration.

Another option may be to just only check for virtual generated columns.

Forum thread: https://forum.djangoproject.com/t/can-we-relax-the-restriction-e042-on-including-generated-fields-in-composite-pks/41438"	Cleanup/optimization	assigned	Database layer (models, ORM)	dev	Normal				Accepted	1	0	0	1	0	0
