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 996 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
101Mixing the use of TEXT and VARCHAR type in case of base table columnsDeclaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA only2024-12-14 13:41MIT License
102Number 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-12-13 19:41MIT License
103Views without security barrierFind views that do not have the security barrier option.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-13 19:30MIT License
104Views with WHERE but without security barrierFind views that do not have the security barrier option but restrict rows in some way.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-13 19:29MIT License
105Explicit locking is missingPostgreSQL uses multiversion concurrency control (MVCC). SELECTs do not block modifications and vice versa. One has to take steps to achieve correct behaviour.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-13 14:57MIT License
106SELECT * in a routine bodySELECT statement should list the columns not use SELECT * to return data from all the columns. Firstly, it ensures, that the query asks only data that is really needed by the routine. It means less data that the DBMS has to fetch and pass to the routine. It could also mean that the DBMS can answer to a query based on an index without reading table blocks. Secondly, it documents the data that is returned by the query. The query does not consider objects that are a part of an extension.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-13 14:34MIT License
107NOT NULL constraint via CHECK instead of NOT NULL constraintFind columns where the NOT NULL constraint has been added with the help of an explicit CHECK constraints instead of a NOT NULL constraint. One should note that internally NOT NULL constraints are treated as a kind of CHECK constraints. Nevertheless, the design should be consistent (i.e., NOT NULL is enforced with the same way in different places).Problem detectionINFORMATION_SCHEMA only2024-12-12 09:42MIT License
108Perhaps inconsistent use of temporal functions (2)Find as to whether in the same database more than one of these functions is used at the same time - now(), localtimestamp, current_timestamp.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-12 00:20MIT License
109Perhaps too many subconditions in a CHECK constraintFind check constraints of base table and foreign table columns that are either associated with more than one column and have at least one AND operation or are associated with exactly one column and have two or more AND operations.Problem detectionINFORMATION_SCHEMA only2024-12-11 23:29MIT License
110FILLFACTOR is probably too small (2)Find base tables that probably implement many to many relationship type, have no clear sign that there are columns that should be updated, but still have fillfactor less than 100.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-11 14:38MIT License
111B-tree index fillfactor has been explicitly set to 90Find B-tree indexes that fillfactor has been explicitly set to 90. In case of B-tree indexes the default is 90.Problem detectionsystem catalog base tables only2024-12-11 14:37MIT License
112Something is still to do in routinesFind routines where comments contain TODO phrase.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-11 12:44MIT License
113Row level triggers that update or delete dataFind row level triggers that update or delete data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-11 12:27MIT License
114Perhaps a CHECK constraint about required personal name components is missingFind base tables that have optional columns for recording both given name and surname and do not have a CHECK constraint that requires that at least one of the name components must be registered in case of each person.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-12-11 12:23MIT License
115Very similar (but not equal) routine namesFind pairs of names of different types of routines that are very similar but not equal.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-11-30 12:09MIT License
116Very similar domain namesFind pairs of names of domains that are very similar or even equal.Problem detectionINFORMATION_SCHEMA only2024-11-30 12:07MIT License
117Very similar table namesFind pairs of names of different types of tables that are very similar or even equal.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-11-30 11:50MIT License
118Multicolumn CHECK constraints with with inconsistent Boolean expressionsFind CHECK constraints that involve two columns, i.e., the cardinality of the constraint is 2, the columns have the same name in different tables, and the Boolean expressions of these constraints are different. For instance, in one table it is last_change_time>=reg_time and in another table it is not (reg_time>last_change_time).Problem detectionsystem catalog base tables only2024-11-30 10:46MIT License
119SQL functions that use optimistic approach for locking but do not return a valueFind SQL functions that use a hidden column of PostgreSQL tables - xmin - to implement optimistic locking but do not return any information to the invoker of the functions, i.e., whether the update/delete operation succeeded or not. The functions should let their invokers know as to whether the function succeeded in updating or deleting a row.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-11-30 10:02MIT License
120CHECK constraints are inconsistent with DEFAULT valuesFind table CHECK constraints that involve two columns that have the same default value. However the constraint assumes that the values must be unequal or one value must be bigger than another.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-11-30 09:58MIT License