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...
221Derived table on top of another derived tableDo not build multiple levels of derived tables (views and materialized views) because it will hamper evolvability and understandability of the tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
222Derived table presents the same data in the same way as a single base tableFind derived tables (views and materialized views) that present data from one base table without adding columns, renaming columns, changing the order of columns, removing columns, or restricting rows. Perhaps something is missing from the subquery of the derived table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-25 12:15MIT License
223Derived tables that have a column with the xid typeFind the derived tables (views and materialized views) that have a column with the xid type, i.e., these use the data from the hidden xmin column of a base table. If one uses optimistic approach for dealing with the concurrent data modifications, then xmin values should be presented by views and used in routines that modify or delete rows.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
224Derived tables that present data in json or xml formatFind views and materialized views that present data in json or xml format. Instead of recording data in this format in base tables one could generate the data value on the fly based on data that has been recorded in base tables.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
225Derived tables with multiple DISTINCT'sFind derived tables (views and materialized views) that contain more than one DISTINCT invocation. Make sure that the query is correctly written, including that it does not have unwanted formation of a Cartesian product.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-10 13:25MIT License
226Derived tables with rankingFind views and materialized views that use rank and dense_rank window functions.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
227Derived tables with sortingFind derived tables where the rows are ordered, i.e., there is ORDER BY clause at the end of the view. Different users may want to see the rows in different order. Thus, the DBMS may have to do extra and unnecessary work by firstly sorting based on one set of rows and after that based on other set of rows. Use sorting if you know that all the users want the rows in the same order and cannot/will not change the order in the application.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-22 21:34MIT License
228Derived tables with string_aggFind views and materialized views that use string_agg aggregate function.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
229Derived table uses a function to get data from another tableFind views that use a function to get data from another table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 14:36MIT License
230Deterministic (immutable) functions that do not have input parametersFind deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 19:53MIT License
231Deterministic (immutable) functions that do not return a valueFind deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-20 19:33MIT License
232Different character maximum lengths that are used to define textual base table columnsFind the number of different character maximum lengths that are used to define textual base table columns as well as list all the different lengths. Show also the total number of columns with char/varchar type. Maximum character length constrains values in a column. Thus, in case there is a small number of used lengths, it raises a question as to whether the lengths have been optimally selected.Sofware measureINFORMATION_SCHEMA only2021-03-26 11:24MIT License
233Different data types that are used to define base table columnsFind the number of different data types that are used to define base table columns as well as list all the different types. Data type constrains values in a column. Thus, in case there is a small number of used types, it raises a question as to whether the types have been optimally selected.Sofware measureINFORMATION_SCHEMA only2020-11-27 10:40MIT License
234Different foreign key column names in case of referencing the same candidate keyFind the cases when the names of columns in different foreign keys that reference to the same candidate key are different. If different names reflect different roles, then it is legitimate. However, there could also be accidental differences that makes it more difficult to use the database.Problem detectionsystem catalog base tables only2021-03-12 11:21MIT License
235Different non-surrogate key default valuesFind the different default values that implement something other than a surrogate key.GeneralINFORMATION_SCHEMA only2021-03-04 10:31MIT License
236Different prefixes of a candidate key column and a referencing foreign key columnThe naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different prefixes. Thus, for instance, one cannot use USING syntax for joining the tables.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
237Different search paths of SECURITY DEFINER functionsFind the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas.GeneralINFORMATION_SCHEMA+system catalog base tables2020-12-16 10:59MIT License
238Different suffixes of a candidate key column and a referencing foreign key columnThe naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different suffixes. Thus, for instance, one cannot use USING syntax for joining the tables.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
239Different tasks of rulesFind different tasks that are solved by using rules, i.e., different rules on the same table or different tables that do the same thing are considered to solve one task.Generalsystem catalog base tables only2024-01-14 16:10MIT License
240Different tasks of triggersFind different tasks that are solved by using triggers, i.e., different triggers on the same table or different tables that do the same thing are considered to solve one task.GeneralINFORMATION_SCHEMA+system catalog base tables2024-01-04 00:53MIT License