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...
781Duplicate removal of duplicates in derived tablesFind derived tables (views and materialized views) that contain both DISTINCT and GROUP BY. Make sure that the means for removing duplicate rows from the query result are not duplicated.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
782Duplication of parent table CHECK constraints on the foreign key columnsFind duplicate constraints, which make it more difficult to maintain the constraints. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
783Empty columnsFind columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
784Foreign key column has a simple check constraint that is attached directly to the tableFind foreign key columns that are covered by a simple check constraint, i.e., the constraint involves only one column. Look only constraints that are directly associated with the table, i.e., are not specified through a domain. Perhaps the constraint should be defined on the referenced candidate key column.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
785Foreign servers without user mappingsFind foreign servers that do not have any associated user mappings. "A user mapping typically encapsulates connection information that a foreign-data wrapper uses together with the information encapsulated by a foreign server to access an external data resource."Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
786Function in a function-based index of a column is different from the function that is used in the subquery of a derived tableFind cases where the function of a function-based index of a column is different from the function that is used in the query in a derived table based on the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
787Generated stored base table columns that expression does not refer to any columnFind generated stored base table columns that expression does not refer to any column of the table. It could be that there will be a constant value in every row in case of this column. The support of generated columns was added to PostgreSQL 12.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
788Gratuitous context in the names of foreign key columnsFind foreign key columns that name contains twice the name of the referenced (primary) table.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
789Inconsistency between the type and the default value of a column (date and timestamp values)Find table columns with timestamp/date types that data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
790Inconsistency between the type and the default value of a column (time values)Find table columns with time types, which data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
791Inconsistency of using parameter data typesFind parameters of routines that have the same name but a different type. Parameters that have the same name should have, in general, the same data type as well, assuming that the routines, which have the parameters, have different names, i.e., there is no overloading in play.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
792Incorrect password hash updateFind row level update triggers that incorrectly implement update of password hash. It should not be that the new password hash is calculated based on the existing hash.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
793Incorrect prevention of the empty string or strings that consist of only spaces in a fieldFind columns of base tables and foreign tables where the requirement that there should not be empty strings or strings that consist of only spaces in the column has been implemented incorrectly - by using the constraint trim(column_name) IS NOT NULL. PostgreSQL (differently from Oracle) does not replace the empty string with NULL. Empty string is a value but NULL is a special marker that denotes a missing value. Thus, in case of such constraint the DBMS checks a proposition '' IS NOT NULL. This is a true proposition and the DBMS does not prevent registration of such a row.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
794Incorrect suffix of a constraint name or an index nameIf the name of an object has the suffix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find suffixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use _chk as the suffix of an index name or _pk as the suffix of a check constraint name.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
795Insufficient routine privilegesYou must give rights to use routines to the users/roles that correspond to applications.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
796Insufficient view privilegesYou must give privileges to use views to the users/roles that correspond to applicationsProblem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
797Mandatory columns for holding large textual values (comments, descriptions, etc.)Find mandatory (NOT NULL) base table columns that name, column type, and field size refers to the possibility that these are used to register large textual values like comments, descriptions, and explanations.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
798No need to use to_date or to_timestamp functionFind expressions where a date literal with the ISO format is converted to date/timestamp by using to_date or to_timestamp function.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
799Non-foreign key columns that have no associated CHECK constraintsFind what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
800Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases notFind non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License