Skip to content

Commit 836894f

Browse files
charettesfelixxm
authored andcommitted
Refs django#470 -- Adjusted Field.db_returning to be backend agnostic.
Determining if a field is db_returning based on the default connection feature availability prevents the usage of RETURNING for db_default fields in setups where non-default backends do support RETURNING. Whether or not the field should be attempted to be returned is already checked at the compiler level which is backend aware.
1 parent b3166e1 commit 836894f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

django/db/models/fields/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,7 @@ def db_tablespace(self):
932932
@property
933933
def db_returning(self):
934934
"""Private API intended only to be used by Django itself."""
935-
return (
936-
self.has_db_default() and connection.features.can_return_columns_from_insert
937-
)
935+
return self.has_db_default()
938936

939937
def set_attributes_from_name(self, name):
940938
self.name = self.name or name

0 commit comments

Comments
 (0)