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 996 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
521Name starts or ends with spacesFind the names of user-defined database objects (must be delimited identifiers) that start or end with spaces.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-21 16:45MIT License
522Naming of declarative base table constraintsFind the names of declarative base table constraints. Naming of constraints must be consistent. For instance, do not mix system-defined and user-defined names.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-17 20:11MIT License
523Naming of tablesFind the names of different types (base table, foreign table, view, materialized view) of tables. Naming of tables must be consistent. For instance, do not mix names in plural and singular form within the same table type.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-17 20:13MIT License
524No 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
525Non-foreign key base table columns with the same name have a different set of CHECK constraintsFind non-foreign key base table columns that have the same name but a different set of check constraints. The use of constraints should be consistent and all the necessary constraints must be enforced. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-11-24 12:06MIT License
526Non-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
527Non-foreign key indexes that have been named as foreign key indexesFind indexes that are not on a foreign key column but the name of the index contains ixfk or idxfk.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-23 12:12MIT License
528Non-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
529Non-predefined character classes must not be between double square bracketsWrite correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-13 12:32MIT License
530Non-updatable views that have data modification privilegesBe precise and do not give impossible privileges.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
531Non-updatable views with DO INSTEAD NOTHING rulesFind non-updatable views that have a DO INSTEAD NOTHING rule. The rule is used to prevent updates. However, the view is aniway non-updatable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-28 13:01MIT License
532No point to have in a procedure COMMIT without ROLLBACK or vice versaIf you end transaction in a procedure, then there should be a possibility to either commit or rollback the transaction based on some condition. Procedures appeared in PostgreSQL 11.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 12:00MIT License
533Not equals check in unstandardized wayFind user-defined routines that use != operator to test as to whether two values are not equal.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-13 14:16MIT License
534Not inherited CHECK constraintsFind CHECK constraints that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. CHECK(false) on a supertable is an appropriate CHECK constraint if one wants to prevent registering data directly to the supertable, i.e., data can only be added to the subtables.Generalsystem catalog base tables only2020-12-27 17:42MIT License
535Not inherited CHECK constraints that are recreated in the immediate subtableFind base table CHECK constraints that have been defined as NOT INHERITED but the constraint with the same Boolean expression has been defined in the immediate subtable of the table.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
536Not inherited CHECK constraints that cover at least one columnFind CHECK constraints that cover at least one column and that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
537NOT IN or <> ALL in derived tablesAvoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor, especially in case of large data sizes.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-24 13:50MIT License
538NOT IN or <> ALL in routinesAvoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-24 13:50MIT License
539NOT NULL constraint is directly associated with a column instead of the domain of the columnFind mandatory (NOT NULL) base table columns that have been defined based on the same domain but the NOT NULL constraint is associated directly with the column not to the domain. PostgreSQL CREATE DOMAIN statement documentation points out that it is possible to add NULL's to columns that have a NOT NULL domain and thus suggests to associate NOT NULL constraints with a column instead of the domain. However, this is a non-standard behavior and defeats the idea of domain as a reusable asset. The scenarios where NULLs can appear in columns with a NOT NULL domain are quite exotic and probably cannot appear in production environments.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-20 15:34MIT License
540NOT NULL constraint via CHECK instead of NOT NULL constraintFind columns where the NOT NULL constraint has been added with the help of an explicit CHECK constraints instead of a NOT NULL constraint. One should note that internally NOT NULL constraints are treated as a kind of CHECK constraints. Nevertheless, the design should be consistent (i.e., NOT NULL is enforced with the same way in different places).Problem detectionINFORMATION_SCHEMA only2024-12-12 09:42MIT License