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...
201Database 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
202Database objects of the same type and case insensitive name in the same containerFind database objects with the same type and case insensitive name in the same container. It can only happen if some of the names are case insensitive and others are case sensitive. For instance, the same schema can contain the table "Client" and clientProblem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:13MIT License
203Database object that belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜFind database object that belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make it more difficult to use the interface by other programs.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
204Database object that do not belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜFind database object that do not belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make the naming style inconsistent with the naming style of elements that belong to the public interface. If applications access base tables directly, then the letters can cause the same problems as in case of derived tables, i.e., applications may have difficulties with such names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
205Data 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
206Declaratively partitioned tables with one partitionFind declaratively partitioned tables that have exactly one partition. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10. If there is only one partition, then it raises question as to why the additional complexity associated with partitioning is needed.Problem detectionINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
207Declaratively partitioned tables without partitionsFind declaratively partitioned tables that do not have any partitions. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
208Default is NULLFind all tables where default value is NULL. NULL is the marker that denotes missing value. Implicitly all columns that do not have a default value have the default NULL. There is no need to specify such default value.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
209Default should be declared at the level of domain not at the level of base table columnsFind domains that have been used to define one or more base table non-foreign key columns and all the columns have the same default value that is associated directly with the column not with the domain. Write as little code as possible. If possible, move things "before the brackets" so to say. In this case it means declaring the default value at the level of the domain and not at the level of base table columns. An exception is when the domain is used to define foreign key columns. In this case, it would be appropriate to define the default value at the column level (because different foreign keys could have different default values).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
210Deferrable constraintsFind all deferrable constraints.Generalsystem catalog base tables only2021-10-08 11:25MIT License
211Deferrable foreign key constraint with a RESTRICT compensating actionFind deferrable foreign key constraint with ON UPDATE RESTRICT or ON DELETE RESTRICT compensating action. Referential actions are carried out before, and are not part of, the checking of a referential constraint. Deferring a referential constraint defers the checking of the of the constraint (a ) but does not defer the referential actions of the referential constraint. In PostgreSQL the essential difference between NO ACTION and RESTRICT is that NO ACTION allows the check to be deferred until later in the transaction, whereas RESTRICT does not. Thus RESTRICT could result with the failure of data modification where in case of NO ACTION the modification would succeed.Problem detectionsystem catalog base tables only2021-10-08 11:29MIT License
212Definition of a non-minimal superkey instead of a candidate key (based on check constraints)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 primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has a check constraint that permits only one value in the column. The candidate key should involve only columns without such constraint.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
213Definition of a non-minimal superkey instead of a candidate key (based on enumeration types)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 primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has an enumeration type that permits only one value in the column. The candidate key should involve only columns without such type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
214Definition of a non-minimal superkey instead of a candidate key (based on key constraints)Find primary/key unique constraints (sets of columns) that are proper subsets of other primary key/unique constraints of the same table. 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 primary key's and unique constraints based on candidate keys, i.e., the keys should not have redundancy in terms of columns.Problem detectionsystem catalog base tables only2021-10-16 10:29MIT License
215Definition of a non-minimal superkey instead of a candidate key (based on sequence generators)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 primary key's and unique constraints based on candidate keys. Find primary keys and unique constraints where a proper subset of the key is a column with an associated sequence generator. Most certainly such subset contains unique values. Thus, this subset should be the key, not its superset.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:56MIT License
216Definition 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
217Delimited identifiersDelimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:38MIT License
218Depth of referential tree of a schemaDepth of referential tree of a database schema is the longest referential path between the tables in this schema (Piattini et al., 2001). In other words, it is the biggest value among the DRT(T) values of all the tables of the schema.Sofware measuresystem catalog base tables only2020-11-14 15:28MIT License
219Depth of relational tree of a tableDepth of relational tree of a table T (DRT(T)) is defined by Piattini et al. (2001) as "the longest referential path between tables, from the table T to any other table in the schema". The result may help to classify the data. If the depth is 0, then probably the table contains classifers. Tables with the largest depth probably contain some extra information about main entities.Sofware measuresystem catalog base tables only2020-11-14 16:13MIT License
220Derived table names have prefix or suffixFind the names of views and materialized views that have prefix or suffix. Follow the same naming style as in case of base tables (derived tables are also tables). Thus, if base tables do not have prefixes or suffixes, then derived tables shouldn't have these as well.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License