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...
661Different search paths of SECURITY DEFINER functionsFind the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-16 10:59MIT License
662The number and percentage of base tables without CHECK constraintsFind the extent in which data integrity is checked at the database level. Find the number and percentage of base tables that do not have any associated CHECK constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:15MIT License
663The number and percentage of base tables without keysFind the extent in which repeating rows are permitted in the database. Find the number and percentage (from the total number of base tables) of base tables that do not have the PRIMARY KEY constraint and also do not have any UNIQUE constraints.Sofware measureINFORMATION_SCHEMA only2020-11-08 19:16MIT License
664ON UPDATE CASCADE is probably missing (based on the properties of the referenced column)Find the foreign key constraints that do not have ON UPDATE CASCADE and that referenced key is a simple key that has an integer type, is not covered by another foreign key, and does not have an associated sequence generator, i.e., the foreign key references a simple natural key.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-04-30 18:39MIT License
665The longest referential pathsFind the longest referential paths between the tables regardless of the schema that contain the tables.Sofware measuresystem catalog base tables only2020-11-14 15:42MIT License
666Names of database objects that contain a digitFind the names (identifiers) of user-defined database objects that contain at least one digit. Names should be informative. Duplicates should be avoided. Digits in names are a possible sign of duplication of database objects or unclear names.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:05MIT License
667Names of database objects that perhaps end with a sequence numberFind the names (identifiers) of user-defined database objects that end with one or more digit. Names should be informative. Duplicates should be avoided. Digits in names are a possible sign of duplication of database objects or unclear names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 10:09MIT License
668Too generic names (columns)Find the names of columns that are too generic. In SQL databases data/information is represented as values in columns. It is not a good style to use generic words like data, information, column, etc. In the names of columns. Moreover, avoid too generic column names like: id, tyyp, kood, aeg, kp,type, code, time, date, fk, pk.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-15 10:33MIT License
669Stating the obvious (column names)Find the names of columns where the name of the column contains a part of the name of the data type of the column. For instance, the query finds columns, were the name contains fragments integer_ or _integer.Problem detectionINFORMATION_SCHEMA only2023-11-04 15:19MIT License
670System-generated table constraint names (constraints that involve one column)Find the names of database constraints that have been system-generated. Additional restrictions are that the constraints must involve only one column and are associated directly with a table (not through a domain). 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.Problem detectionsystem catalog base tables only2021-12-10 12:47MIT License
671Perhaps 0 instead of oFind the names of database objects where 0 sign is perhaps used instead of o.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:13MIT License
672Names of database objects with perhaps too many digitsFind the names of database objects where more than half the signs are digits.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:36MIT License
673Stating the obvious (2)Find the names of database objects where the name of the database object contains a part of the name of the object type. For instance, the query finds base tables, were the name contains fragments _base, base_, _table, or table_.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-26 17:04MIT License
674Naming 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
675Naming 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
676System-generated domain CHECK constraint namesFind the names of domain CHECK constraints that have been system-generated. 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.Problem detectionINFORMATION_SCHEMA only2022-10-27 15:44MIT License
677Perhaps a too generic foreign key column nameFind the names of foreign key columns that are too generic. The expressive names of table columns allow database users better and more quickly understand the meaning of data in the database. A person could participate in a process or be associated with an object due to different reasons. Thus, foreign key column names like isik_id, person_id, tootaja_id, worker_id etc. are too generic. The name should refer (also) to the reason why the person is connected.Problem detectionsystem catalog base tables only2023-03-15 18:27MIT License
678Too generic names (parameters)Find the names of parameters that are too generic. The routines work with data/information. Thus, it is not a good style to use generic words like data, information, parameter, etc. In the names of parameters. Moreover, avoid too generic parameter names like: id, tyyp, kood, aeg, kp,type, code, time, date, fk, pk, param.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 14:08MIT License
679Perhaps primary key columns could be renamedFind the names of simple primary key columns that name does not follow the pattern _id or _code but it is quite similar.Problem detectionsystem catalog base tables only2022-12-01 14:34MIT License
680The same CHECK has a different name in different placesFind the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionsystem catalog base tables only2023-01-14 20:47MIT License