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...
281Columns with BYTEA or OID typeFind columns with BYTEA or OID type. These columns are potentially meant for storing large objects. Each columns should have the most appropriate data type.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-19 17:00MIT License
282Columns with JSON, JSONB, or XML typeFind columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-19 17:01MIT License
283Columns with only one valueFind base table columns that contain only one value. Perhaps it is an unnecessary column. Having only one value is most likely inadequate for testing.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
284Columns with tsvector typeFind columns of base tables and materialized views that have tsvector type.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-22 12:41MIT License
285Comments of routinesFind comments of user-defined routines (functions or procedures) that are registered in the system catalog witht a COMMENT statement. Make sure that the comments give relevant, useful, and correct information.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
286Completely overlapping foreign keysFind completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
287Consistency of comments of routinesFind user-defined routines that have a comment registered by the COMMENT statement and a comment within the routine body. Make sure that there are no inconsistencies between the comments.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-04 10:56MIT License
288Consistency of using generic column names in candidate key columns that are not foreign key columnsFind the names on base table columns that are a part of a candidate key but not a foreign key and contain a generic word (nimi, nimetus, kommentaar, kirjeldus, name, comment, description, etc.). Make sure that naming of these is consistent, i.e., such names always contain the table name or never contain the table name.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:53MIT License
289Consistency of using generic column names in non-candidate key columns that are also not foreign key columnsFind the names on base table columns that are not a part of a candidate key and a foreign key and contain a generic word (nimi, nimetus, kommentaar, kirjeldus, name, comment, description, etc.). Make sure that naming of these is consistent, i.e., such names always contain the table name or never contain the table name.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:53MIT License
290Constraints that are not redefined in a subtable and there is no CHECK constraint that compensates thisFind primary key, unique, foreign key, and exclude constraints that have been defined in a supertable (parent table) but not in its subtable. Additional condition is that in case of the subtable there is no CHECK that permits only one specific value in the constraint column. The presence of such check would make the design acceptable. Unfortunately, PostgreSQL table inheritance is implemented in a manner that some constraints (CHECK, NOT NULL) are inherited from the supertable but others are not. "All check constraints and not-null constraints on a parent table are automatically inherited by its children, unless explicitly specified otherwise with NO INHERIT clauses. Other types of constraints (unique, primary key, and foreign key constraints) are not inherited." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
291Constraints that are not redefined in a subtable but there is a CHECK constraint that compensates thisFind primary key, unique, foreign key, and exclude constraints that have been defined in a supertable (parent table) but not in its subtable. Exclude constraints where in case of the subtable there is a CHECK that permits only one specific value in the constraint column. The presence of such check would make the design acceptable. Unfortunately, PostgreSQL table inheritance is implemented in a manner that some constraints (CHECK, NOT NULL) are inherited from the supertable but others are not. "All check constraints and not-null constraints on a parent table are automatically inherited by its children, unless explicitly specified otherwise with NO INHERIT clauses. Other types of constraints (unique, primary key, and foreign key constraints) are not inherited." (PostgreSQL documentation)GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-25 16:20MIT License
292Coverage by derived tablesFind for each base table the list of derived tables (both views and materialized views) that refer to the base table. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from the subquery of at least one derived table.GeneralINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:31MIT License
293Coverage by routines that have the SQL-standard bodyFind for each base table the list of routines (functions and procedures) that refer to the base table. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from at least one routine.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-05 17:00MIT License
294Cycles in relationshipsFind as to whether foreign key constraints between tables form a cycle. For instance, if table C refers to table B, table B refers to table A, table A refers to table C and all the foreign key columns are mandatory, then one cannot add data to the tables. Is cycle value in the result should not contain value TRUE. One should check manually as to whether the foreign key columns are mandatory or optional.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-28 15:15MIT License
295Database 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
296Database 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
297Database 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
298Database 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
299Declaratively 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
300Declaratively 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