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...
241Simple 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
242Do not use approach that one size fits all (primary key columns)Find base base tables have the simple primary key that contains the column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 20:58MIT License
243Very similar column namesFind the pairs of table columns that name is different only by one symbol and that have the same type and/or domain.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 20:25MIT License
244The name of the base table that implements a binary relationship type does not explain the meaning of the relationshipFind base tables that implement a binary relationship type (have two foreign keys) and the name of the table consist of the names of tables that this (intermediate) table connect. The names should be derived from the domain. For instance, instead of name Course_Lecturer it is better to have name Teaching.Problem detectionsystem catalog base tables only2023-03-18 17:58MIT License
245The longest names of database objectsFind the TOP 3 longest (identifiers) names of user-defined objects.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:22MIT License
246Perhaps too many different prefixes in the names of database objects that have the same typeOne should be consistent in naming, including in the use of prefixes. If you use prefix in the name of a database object, then it should refer to the type of the database object. Do not use different prefixes in the names of database objects that have the same type. Find types of database objects in case of which there are different prefixes in different names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:16MIT License
247Inconsistent names of database objects that are used to manage the state of main objects in the database"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) The naming must be consistent. One should avoid mixing synonyms like "seisund", "staatus", and "olek" in Estonian or "state" and "status" in English and stick with one term. For instance, it is a bad practice to use word "state" in table names but word "status" in function names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:13MIT License
248The number and percentage of different names of database objectsNames should be expressive. Find the number of different names used in a database as well as the number of named database objects, and the percentage of different names from all the names. Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects and compare it with the total number of database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:12MIT License
249Median and average of the length of names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the median length and average (arithmetic mean) length of the names (identifiers) of user-defined database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:05MIT License
250The number of names of database objects by the number of subcomponents in the names"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the number of names (identifiers) of user-defined database objects by the number of subcomponents in the names. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:02MIT License
251Frequent names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the names (identifiers) of user-defined database objects that occur at least twice as frequently as a name occurs in average in case of the particular type of database objects. Also make sure that there is no duplication in play.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:57MIT License
252The shortest names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the shortest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:54MIT License
253Names of database objects that are used to manage the state of main objects in the database"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) The naming must be consistent. One should avoid mixing synonyms like "seisund", "staatus", and "olek" in Estonian or "state" and "status" in English and stick with one term.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:53MIT License
254Names of database objects that start with an underscoreImprove the readability of names. Find the names (identifiers) of user-defined database objects that start with an underscore. This is not necessarily a mistake. For instance, parameter names could start with an underscore. On the other hand, it could be that the prefix is missing in the name.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:49MIT License
255Names of database objects that contain two or more consecutive underscores or spaces as separators of name componentsImprove the readability of names. Find the names (identifiers) of user-defined database objects that contain two or more consecutive underscores or spaces that separate name components, i.e., these are not at the beginning and in the end of the name. Example of such names are person__id or "person id". Names with duplicate underscores use snake case style but duplication of underscores does not improve the usability of the name.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:48MIT License
256Perhaps is not snake_case - long subsections without underscoresFind names that perhaps do not use the snake_case naming style because the name contains a long subsection (at least 20 characters) without underscores. Prefer snake_case over PascalCase and camelCase in names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:47MIT License
257The number of names that use different writing stylesFind the number of names of user-defined database objects that use snake_case, ALL CAPS, Sentence case, camelCase or PascalCase style. Make sure that the naming style is consistent.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:44MIT License
258Using in some way reserved (in PostgreSQL) SQL keywords as the names of a database object (detailed view)"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should not cause confusion. Find the names (identifiers) of user-defined objects that are SQL keywords that are not completely unreserved in PostgreSQL, i.e., these either never cannot be used as regular identifiers or cannot be used in case of some type of database objects. In PostgreSQL "there are several different classes of tokens ranging from those that can never be used as an identifier to those that have absolutely no special status in the parser as compared to an ordinary identifier. " (PostgreSQL manual) Moreover, such identifiers are often too general, i.e., do not provide enough information about the named object.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:39MIT License
259Delimited identifiersDelimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:38MIT License
260Names 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