Catalog of PostgreSQL queries for finding information about a PostgreSQL database and its design problems

AND
AND
AND
ANDFrom where does the query gets its information?
AND
AND

There are 961 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
741Views with the WITH LOCAL CHECK OPTION constraintFind updatable views that have WITH LOCAL CHECK OPTION constraint. The predicate of a view is the conjunction of the predicates of its (directly and indirectly) underlying tables (both base tables and derived tables) as well as the predicate of the view itself. In case of using WITH LOCAL CHECK OPTION constraint "New rows are only checked against the conditions defined directly in the view itself. Any conditions defined on underlying base views are not checked (unless they also specify the CHECK OPTION)." (PostgreSQL manual) Thus, use instead WITH CASCADED CHECK option to instruct the system to check new rows against the entire predicate of the view.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
742Wrong comment - trigger function does not implement a database operationTrigger functions should not contain references to database operations. Perhaps the trigger implements ensuring some invariant of the operation but it does not implement the operation itself.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
743All columns of a base table have a default valueFind base tables where all the columns have a default value.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
744Base table column name is the same as its domain nameFind base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
745Base table column of measurements does not have a correct data typeFind base table columns that name refers to the possibility that these are used to register measurement results. Find the columns that do not have an integer or numeric type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
746Base table column of national identification numbers does not have a correct data typeFind non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
747Base table column of national identification numbers has a too short field sizeFind base table columns with VARCHAR type that name refers to the possibility that these are used to register national identification numbers (personal codes). Find the columns where the field size is shorter than 20.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
748Base table column of quantities does not have a numeric type (based on column names)Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
749Base table columns permitting e-mail addresses without @ signFind non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
750Base table columns permitting empty strings and strings that consist of only whitespace charactersFind non-foreign key columns of base tables that have a textual type and do not have any simple CHECK constraint, i.e., a constraint that involves only one column. Such columns can contain the empty string and strings that consist of only whitespace.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
751Base table columns where TOAST-ing strategy has been changed to plainFind base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
752Base table columns with the type VARCHAR(1)The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
753Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columnsIdentify possibly missing CHECK constraints.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
754Base tables and foreign tables that have no CHECK constraintsWhat are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
755BOOLEAN base table and foreign table columns with a CHECK constraint that involves olnly this columnFind base table and foreign table columns with the Boolean type that has a CHECK constraint that involves only this column. Avoid unnecessary CHECK constraints. The Boolean type contains only two values and there is nothing to check. By creating a check that determines that possible values in the column are TRUE and FALSE, one duplicates the attribute constraint (column has a type). This is a form of duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
756Cannot register all legal e-mail addressesFind CHECK constraints on base table or foreign table columns that contain data about e-mail addresses and apply unnecessary restrictions to the these, rejecting potentially some legal addresses. More precisely, find CHECK constraints that prevent registration of e-mail addresses with multiple @ signs.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
757Cannot register all legal personal namesFind CHECK constraints on base table or foreign table columns that contain data about personal names and apply unnecessary restrictions to the names, rejecting potentially some legal names. Find checks that prohibit a digit or require a letter A-Z.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
758Case sensitive and case insensitive uniqueness of the same simple keyFind sets of columns that have both case sensitive and case insesitive unique constraints enforced based on these columns. In case of textual columns uniqueness could be checked either in case sensitive or case insensitive way. It is a contradiction to check the uniqueneness in both ways in case of the same key.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
759CHECK constraint with pattern matching on non-textual columnsFind base table and foreign table columns that do not have a textual type but have a single-column check constraint that uses pattern matching. The use of a regular expression, a LIKE clause, or a SIMILAR TO clause in order to constrain values in a non-textual column points to the incorrect selection of operator or column data type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
760CHECKs are associated with a column instead of the domain of the columnFind simple check constraints (involve one column) that are associated with a base table column instead of the domain of the column. Common checks of data in columns that share the same domain should be described at the level of domain not at the level of columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License