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...
141Names of columns with the type BOOLEANThe naming of BOOLEAN columns must be consistent. For the better readability the names of such columns could have prefix "is_" (in English) or "on_" (in Estonian)GeneralINFORMATION_SCHEMA+system catalog base tables2024-01-03 09:41MIT License
142Names 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
143Names 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
144Names 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
145Names of the password columnsFind names of columns of base tables, views, and materialized views that contain passwords. Make sure that the naming is consistent,GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-30 15:04MIT License
146Names of triggers and rules that do contain the table nameThe names should contain table name in order to make the names better understandable.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-13 19:23MIT License
147Naming 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
148Naming 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
149Not 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
150NOT 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
151Number of rows in base tablesFind the number of rows in base tables.Generalsystem catalog base tables only2022-10-27 19:44MIT License
152One-to-one relationshipsFind one-to-one relationships between base tables. In this case the foreign key columns must have primary key or unique constraint. These tables could implement inheritance hierarchy that has been specified in the conceptual data model.Generalsystem catalog base tables only2023-01-06 13:39MIT License
153Only one value permitted in a base table or a foreign table column (based on check constraints)Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. The constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable or is used to enfore the rule that the table can have at most one row.GeneralINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:14MIT License
154Optional base table columnsFind optional base table columns, i.e., columns that permit NULLs. Are you sure you want to allow NULLs in these columns?GeneralINFORMATION_SCHEMA only2020-11-21 03:02MIT License
155Optional foreign key columnsFind foreign key columns that do not have the NOT NULL constraint. It is better to limit the use of NULLs and optional columns due to the problems that it causes in interpreting the query results, making queries, and enforcing constraints. In addition, one should check as to whether this kind of design is consistent with the multiplicities in the conceptual data model.GeneralINFORMATION_SCHEMA only2023-11-17 18:36MIT License
156Overlapping non-function based indexes that have the same leading column but with different operator classFind non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.Generalsystem catalog base tables only2023-10-28 15:05MIT License
157OverloadingMake sure that there is genuine overloading instead of duplication or dead code. "In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations." (Wikipedia) In PostgreSQL one can do it automagically by having multiple routines with the same name but different parameters in the same schema.GeneralINFORMATION_SCHEMA+system catalog base tables2021-12-20 11:40MIT License
158Paramtetes with an array type, XML, JSON, or JSONB typeFind parameters of user-defined routines that type is an array type, xml, json, or jsonb type. Make sure that the parameter name matches the type (perhaps should be in plural).GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:21MIT License
159Partial or case insensitive unique indexesFind partial or case insensitive unique indexes. These implement uniqueness constraints that are impossible to enforce with the help of SQL's regular UNIQUE constraint.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
160Patterns of the Boolean expressions of simple CHECK constraintsFind patterns of the Boolean expressions of simple CHECK constraints (involve only one column). Do not solve the same task in different places differently. The same rule could be implemented with CHECK constraints that have different Boolean expressions. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-13 16:06MIT License