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...
521Database connect privilege is missingFind non-superusers who have a privilege to use a table or a routine but do not have the privilege to connect to the database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-21 13:51MIT License
522Base table column of national identification numbers does not have a correct data typeFind non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
523Non-updatable views with DO INSTEAD NOTHING rulesFind non-updatable views that have a DO INSTEAD NOTHING rule. The rule is used to prevent updates. However, the view is aniway non-updatable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-28 13:01MIT License
524NOT VALID foreign key constraintsFind not valid foreign key constraints. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
525One-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
526Optional base table columns that have a default value that is not the empty stringFind optiona base table columns that have a default value that is not the empty string. Such columns should be mandatory.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
527Optional 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
528Perhaps default value 'infinity' is missingFind optional base table columns that have a timestamp type and do not have a default value.Problem detectionINFORMATION_SCHEMA only2023-11-12 11:52MIT License
529Optional non-foreign key base table columns that participate in a UNIQUE constraint or indexFind optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 10:45MIT License
530Optional base table columns that participate in a UNIQUE constraint or indexFind optional base table columns that participate in a UNIQUE constraint or index. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 15:57MIT License
531Optional composite foreign keys that do not have MATCH FULL specifiedFind optional composite foreign keys that do not have MATCH FULL specified. Without MATCH FULL the system will permit partial foreign key valuesProblem detectionsystem catalog base tables only2021-02-25 17:29MIT License
532Duplicate non-fuction based unique indexesFind pairs of non-function based unique indexes that cover the same set of columns. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. For instance, it helps us to find unique indexes that have been defined to already unique columns.Problem detectionsystem catalog base tables only2022-10-21 10:17MIT License
533Definition of a non-minimal superkey instead of a candidate key (based on unique indexes)Find pairs of non-partial unique indexes where the columns of a index are a proper subset of the columns of another index. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. Exclude the pairs where both participants have been created to support a constraint. Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define keys based on candidate keys, i.e., the keys should not have redundancy in terms of columns. Defining a unique index essentially means defining a key in the table but it is done at the lower level of abstraction.Problem detectionsystem catalog base tables only2022-10-21 15:56MIT License
534All short cycles (tables)Find pairs of tables that have both a foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-27 20:54MIT License
535Short cycles (tables)Find pairs of tables that have both a mandatory (NOT NULL) and not defrerrable foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-27 20:52MIT License
536Too generic names (parameters) (there is a parameter with a more specific name in the routine)Find parameter names in case of which the same routine has another parameter with the same mode but with more specific name, i.e., the name contains the parameter name in the end or in the beginning.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-06 12:03MIT License
537Inconsistency of using parameter data typesFind parameters of routines that have the same name but a different type. Parameters that have the same name should have, in general, the same data type as well, assuming that the routines, which have the parameters, have different names, i.e., there is no overloading in play.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
538All parameters with DEFAULT valuesFind parameters of user-defined routines that have a default value.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
539Paramtetes 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
540Parameter name contains the routine nameFind parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 18:03MIT License