#14248 closed (invalid)
Date and DateTime fields, auto_now_add and PostgreSQL
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
PostgreSQL allows using function "now()", "current_date()", "current_time()" in columns. Why does you not use it?
Change History (3)
comment:1 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 14 years ago
For future reference (in case we ever revisit this): although the functions provided by PostgreSQL are non-standard and not supported across all backends, PostgreSQL, along with all SQL-compliant dbs, provide constant-like functions CURRENT_TIMESTAMP
, CURRENT_DATE
, etc, that provide the same functionality. What I don't know at the moment (and aren't motivated to check right this minute) is if there are any backends we support which don't implement this part of the SQL standard.
Note, however, that this doesn't make this bug a laydown "accept". There are advantages to implementing auto_now
and auto_now_add
in Python -- it allows them to be overridden as part of the saving process (for timezone adjustments in some funky situation, for example).
Some reasons:
Thanks!