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...
801Do not always depend on one's parent (INFORMATION_SCHEMA)Find where a hierarchical structure is implemented in a base table by having a foreign key that refers to a candidate key of the same table. This design is called adjacency list.GeneralINFORMATION_SCHEMA only2021-03-07 10:57MIT License
802Inconsistent data type usage in case of registering a symbolFind whether the database uses both CHAR(1) and VARCHAR(1) columns to register a single symbol.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
803Double negatives in regular expressionsFing regular expression patterns that use [^\S] instead of \s or [^\D] instead of \d or [^\W] instead of \w.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:01MIT License
804Number 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
805Input parameters that names do not follow the convention to start with _ or p_For the sake of making code better understandable follow naming conventions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
806Names of database objects that are fully uppercaseFull uppercase means screaming and it makes comprehending the names more difficult. Find the names (identifiers) of user-defined database objects that are fully uppercase. Because PostgreSQL stores regular identifiers lowercase in the system catalog it also means that these are delimited identifiers, i.e., these are case sensitive.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:28MIT License
807Percentage of the total index storage size from the total database storage size (system catalog included)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
808The storage size of each index (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
809The storage size of each table (including indexes) (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
810The total storage size of all indexes (the system catalog excluded)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
811The total storage size of the database (the system catalog included)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
812The storage size of each schema data object (the system catalog excluded)Get overview of disk usage by different schema objects that contain user data.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
813Data type usage in the base table columnsGet overview of used data types in the columns of base tables. If the selection is very small then this is a warning sign that perhaps unsuitable types have been used.GeneralINFORMATION_SCHEMA only2023-12-22 12:39MIT License
814Disabled rulesIdentify disabled rules. These should be enabled or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2022-10-21 11:22MIT License
815Disabled user triggersIdentify disabled triggers. These should be enabled or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
816Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columnsIdentify possibly missing CHECK constraints.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
817The number of domains by schema and in totalIdentify the number of domains in different schemas.Sofware measureINFORMATION_SCHEMA only2020-11-06 14:51MIT License
818The number of sequence generators in different schemasIdentify the number of sequence generators in different schemas. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys at the database level. An alternative is to implement generation of unique values at the application level or at the database level by using triggers. However, such implementation would most probably lead to the performance penalty because adding new rows to the table must be serialized, i.e., it can be done in one session at a time.Sofware measureINFORMATION_SCHEMA only2021-03-07 20:55MIT License
819Triggers with SELECT (i.e., probably check data based on another table)If a trigger is used for enforcing a constraint, then it should take into account that due to the implementation of multiversion concurrency control (MVCC) in PostgreSQL, reading data does not block data modification and vice versa. Thus, there may be a need to lock the entire table or some row explicitly.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
820Missing USAGE privileges on schemaIf a user has a privilege to use a schema object, then the user must also have the usage privilege on the schema that contains the object.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-21 12:06MIT License