﻿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
33517	Extracting seconds also returns fractional seconds on PostgreSQL and Oracle.	Joey Lange	Hisham Mahmood	"In the Django documentation (https://docs.djangoproject.com/en/4.0/ref/models/querysets/#second) the `__second` extractor is implied to be dealing with integer values for second in a date time. In at least PostgreSQL, the values from `EXTRACT`ing `second` from a date time will include ""any fractional seconds"" (https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT) which means it could be more specific than an integer.

Because of the implication in Django's documentation, I had expected this filter to work as expected for a row whose `date_created` and `date_modified` are within a second of each other but a couple of milliseconds off:

`.filter(date_created__second=F(""date_modified__second""))`

However, that ends up not being true given the Postgres behavior.

My recommendation is merely a documentation update to highlight the discrepancy of behavior between a value coalesced to Python from the DB data, and how the column values are perceived on the database side within a query. I'm struggling for adequate language to explain in such a context, though :-P happy to discuss further and work together toward this improvement."	Bug	closed	Database layer (models, ORM)	4.0	Normal	fixed	oracle postgresql	Mohamed Nabil Rady	Accepted	1	0	0	0	0	0
