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...
521No 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
522Not 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
523Not 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
524Not 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
525Not 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
526NOT 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 tables2021-02-25 17:30MIT License
527NOT 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 tables2021-10-25 16:42MIT License
528NOT 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
529NOT NULL domainsFind domains with NOT NULL constraints and base table columns that have been defined based on 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.GeneralINFORMATION_SCHEMA+system catalog base tables2023-10-20 19:10MIT License
530NOT VALID foreign key constraintsFind not valid foreign key constraints. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
531Number of columns covered with constraintsFor different types of constraints find the number of columns covered with constraints of such type.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-10-16 11:01MIT License
532Number of derived tables that aggregate dataFind the number of derived tables that aggregate data.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 12:33MIT License
533Number of rows in base tablesFind the number of rows in base tables.Generalsystem catalog base tables only2022-10-27 19:44MIT License
534Number of system-generated and user-defined constraint names by constraint type (constraints that involve more than one column)Find the number of system-generated constraint names by constraint type. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Sofware measuresystem catalog base tables only2023-01-10 14:53MIT License
535Number of system-generated and user-defined constraint names by constraint type (constraints that involve one column)Find the number of system-generated constraint names by constraint type. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Sofware measuresystem catalog base tables only2023-01-10 14:52MIT License
536Number of tables covered by derived tablesFind the number of base tables, the number of base tables that are referred from at least one derived table (view or materialized view), the number of base tables that are referred from at least one view, and the number of base tables that are referred from at least one materialized view. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from the subquery of at least one derived table.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:33MIT License
537Number of underlying tables of derived tablesFind for each view or materialized view the number of tables based on which the derived table has been directly defined. These tables could be base tables or derived tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:30MIT License
538Number of used tablesFind statistics about how many derived tables have how many different underlying tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:43MIT License
539Number of using viewsFind statistics about how many base tables have how many derived tables that use these tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:42MIT License
540Number of views with and without security barrierFind the number of views, the number of views with and without security barrier setting, and the names of views with and without the security barrier setting.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 12:54MIT License