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...
421Base tables where uniqueness is achieved by using only unique indexesFind base tables where uniqueness is achieved by using only unique indexes, i.e., there is at least one unique index but no uniqueness constraints (PRIMARY KEY, UNIQUE, EXCLUDE)Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 01:54MIT License
422Base tables with the biggest number of rowsFind the base tables that belong to the top 5 in terms of the number of rows in the table. There should be test data in the tables.Generalsystem catalog base tables only2022-10-21 01:48MIT License
423Base tables where all the unique columns are optionalFind the base tables where all the unique columns are optional. In such tables there can be rows without values that identify these rows. In this case there can be rows in the table where the values that should identify the row are missing.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 01:47MIT License
424Update prevention may prevent legal updatesFind triggers that try prevent updating data in a certain column but prevent also certain legal updates - updates that write to a field a value that was in the field before the update.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-07-07 13:12MIT License
425Perhaps the column type should be UUIDFind base table columns that do not have uuid type but the name of the column refers to the possibility that the values in the column are uuid's.Problem detectionINFORMATION_SCHEMA only2022-06-09 15:07MIT License
426Do not specify a list of values in a table column definitionFind cases where the list of valid data values in the column is specified in the column definition (in addition to specifying the type of the column) by using, for instance, check constraints or enumerated types. The check constraint is either associated directly with a table or is associated with a domain.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-06-09 14:30MIT License
427IS NULL check is probably not neededFind CHECK constraints that refer only to mandatory columns but the Boolean expression has IS NULL condition.Problem detectionINFORMATION_SCHEMA only2022-06-09 13:57MIT License
428Password is uniqueFind columns that potentially contains passwords and that participate in a unique constraint or indexProblem detectionINFORMATION_SCHEMA+system catalog base tables2022-06-09 13:21MIT License
429Base table column of comments/descriptions has an incorrect data type or maximum character lengthFind base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values.Problem detectionINFORMATION_SCHEMA only2022-05-01 13:39MIT License
430ON UPDATE CASCADE is not needed (based on surrogate keys)Find foreign key constraints that reference to a candidate key that is a surrogate key, i.e., its values are generated by the system by using sequence generators. Do not use ON UPDATE CASCADE in case of foreign keys that reference to surrogate keys.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-04-30 18:39MIT License
431ON UPDATE CASCADE is perhaps missing (based on the compensating actions of other foreign key constraints)Find inconsistencies of using ON UPDATE CASCADE in case of foreign key constraints. An example of inconsistency is that there are two foreign key constraints in different tables that refer to the same table and its candidate key. One of the constraints has ON UPDATE CASCADE compensating action one does not. ON UPDATE CASCADE usage should be consistent, otherwise it does not allow us to change key values in the primary table. More generally, there is a set of foreign key constraints F that refer to a candidate key of table T. It cannot be the case that a proper non-empty subset of these foreign keys have ON UPDATE CASCADE compensatory action. Either all the constraints in F should have it or none of it should have it (depending on circumstances).Problem detectionsystem catalog base tables only2022-04-30 18:39MIT License
432ON 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
433CHECK constraint cardinality is zeroWrite correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-04-22 17:06MIT License
434Boolean column for genderFind base table columns that have Boolean type and based on the column name are meant for recording data about gender.Problem detectionINFORMATION_SCHEMA only2022-04-18 00:57MIT License
435Many-to-many relationship types that do not have additional attributesFind base tables that implement many-to-many relationship types that do not permit repeating relationships. More specifically find tables that have two or more foreign keys and all the columns of the table are either foreign key columns or a surrogate key column. It could be that during the system analysis a mistake has been made and some attributes of the entity type that represents the relationship type have not been discovered.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-01-21 10:48MIT License
436ROW level BEFORE triggers that do not return a row if a check succeedsFind ROW level BEFORE triggers that check a condition based on other rows, raise an exception but do not return the row if the condition check succeeds, i.e., exception is not raised.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-31 17:29MIT License
437PUBLIC has TEMPORARY privilege in the databaseFind as to whether PUBLIC (all current and future users) has TEMPORARY privilege in the database. PUBLIC gets the privilege by default.Problem detectionsystem catalog base tables only2021-12-31 15:52MIT License
438Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign serversFind excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application.Problem detectionsystem catalog base tables only2021-12-31 14:40MIT License
439Unnecessary usage privileges of PUBLICPostgreSQL gives by default some privileges to all the present and future database users (PUBLIC). Find usage privileges of collations, domains, foreign data wrappers, foreign servers, and sequences that have been given to PUBLIC.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-31 13:53MIT License
440Trigger routines with TG_OP variable that are not associated with a suitable triggerAutomatically defined TG_OP variable in a trigger function has data type text. Its value is a string of INSERT, UPDATE, DELETE, or TRUNCATE telling for which operation the trigger was fired. Find the routines that according to the TG_OP value must react to a certain operation but the routine is not associated with any triggers that are fired by the operation. For instance, the routine specifies reaction to DELETE operation but the routine is not associated with any DELETE trigger.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-25 01:26MIT License