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...
601ROW level BEFORE triggers that do not return a row if a check succeedsFind ROW level BEFORE triggers that check a condition based on other rows, raise an exception but do not return the row if the condition check succeeds, i.e., exception is not raised.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-31 17:29MIT License
602ROW level BEFORE UPDATE triggers that do not return the new rowFind row level BEFORE UPDATE triggers that do not return the new row version. Exclude triggers that raise WARNING/EXCEPTION.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-08 15:59MIT License
603Perhaps incorrect WHEN clauseFind row level triggers that have action condition (WHEN clause) but the Boolean expression in its specifications does not refer to neither NEW nor OLD variable.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
604Incorrect 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
605Rules with the same name in different schemasFind rule names that are used in a database in more than one schema. Different things should have different names. But here different rules have the same name. Also make sure that this is not a duplication.Generalsystem catalog base tables only2020-11-06 14:51MIT License
606Gratuitous context in the names of schema objectsFind schema objects that name starts with the schema name and then has at least one more symbol. "Shorter names are generally better than longer ones, so long as they are clear. Add no more context to a name than is necessary" (Robert C. Martin, Clean Code) Shema is a namespace. There cannot be in the same schema two schema objects that belong to the same name class and have the same name.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
607PUBLIC has the USAGE privilege of a schemaFind schemas where PUBLIC has the usage privilege.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-23 17:52MIT License
608Empty schemasFind schemas without schema objects.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-04 15:30MIT License
609All non-unique indexesFind secondary indexes that have been created in the database.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-23 11:50MIT License
610SECURITY INVOKER routines that access dataFind SECURITY INVOKER routines that read rows from a table, add rows to a table, update rows in a table, or delete rows from a table. Better to have for these purposes SECURITY DEFINER routines, which make it possible to give to the users privileges to only execute routines without having rights to access their underlying tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 10:44MIT License
611Potentially unused sequence generatorsFind sequence generators that are not associated with any column through the default value mechanism. Please note, that it is also possible to refer to a sequence generator from a routine or from an application. If these are indeed not used, then these should be dropped, otherwise these are dead code.Problem detectionINFORMATION_SCHEMA only2021-03-07 20:56MIT License
612Sequences that are not owned by a table columnFind sequence generators that are not owned by a table column, i.e., if one drops the table or the column, then the sequence generator stays in place.Problem detectionsystem catalog base tables only2023-10-06 14:40MIT License
613Case 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
614Simple check constraints with multiple tasksFind simple check constraints, i.e., check constraints that cover one column that seem to have multiple tasks. The corresponding code smell in case of cleaning code is "G30: Functions Should Do One Thing". (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-01 11:42MIT License
615CHECKs 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
616Potentially unnecessary use of sequence generatorsFind simple natural key columns that are associated with a sequence generator.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-07 21:06MIT License
617Simple primary keys that column name does not contain the table nameFind simple primary keys that column name does not contain the table name. The naming should be clear and consistent.Problem detectionsystem catalog base tables only2023-03-19 10:35MIT License
618SQL function does not return a valueFind SQL functions that do not return a value (return VOID) but the SQL statement in the function has RETURNING clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-02-27 17:28MIT License
619Multiple RETURNING clauses in a SQL functionFind SQL functions that have multiple statements with the RETURNING clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-21 13:59MIT License
620SQL functions that use optimistic approach for locking but do not return a valueFind SQL functions that use a hidden column of PostgreSQL tables - xmin - to implement optimistic locking but do not return any information to the invoker of the functions, i.e., whether the update/delete operation succeeded or not. The functions should let their invokers know as to whether the function succeeded in updating or deleting a row.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 13:06MIT License