| Goal | Be precise and write as little code as possible. Prefer expressions with simple invocations of functions like localtimestamp, current_timestamp, and current_date over expressions like (now())::date. Find table columns that have a default value that casts the type of the returned value of a non-deterministic function (now, localtimestamp, current_timestamp, and current_date). |
|---|---|
| Notes | The query finds default values that are associated directly with a base table column as well as default values that are specified through a domain. The query does not find default values of domains that are not associated with any table. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Medium (Medium number of false-positive results) |
| License | MIT (opens in new tab) |
| Data Source | INFORMATION_SCHEMA only |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems about base tables
A selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview
Find problems automatically
Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .
| Name | Description |
|---|---|
| Find problems about base tables | A selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview |
| Find problems automatically | Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not . |
Categories
This query is classified under the following categories:
Default value
Queries of this catergory provide information about the use of default values.
System-defined functions
Queries of this category provide information about the use of system-defined functions.
Temporal data
Queries of this category provide information about temporal (time-related) data that is kept in the database.
| Name | Description |
|---|---|
| Default value | Queries of this catergory provide information about the use of default values. |
| System-defined functions | Queries of this category provide information about the use of system-defined functions. |
| Temporal data | Queries of this category provide information about temporal (time-related) data that is kept in the database. |