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...
621The SQL-language routines with the body that is string literalFind SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 18:20MIT License
622Incorrect characterization of a user-defined routine as a "stable" routineFind stable routines that contain INSERT, UPDATE, DELETE, SELECT … FOR UPDATE, or LOCK statement. The DBMS should get a correct background information about the behaviour of a routine. Stable routines cannot modify data in a database, lock tables, or its specific rows.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 13:59MIT License
623STATEMENT level triggers that refer to the values of row variables NEW or OLDFind STATEMENT level triggers that refer to the values of row variables NEW or OLD. NEW and OLD are special variables that can only be used in row-level trigger procedures.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-20 14:23MIT License
624Number of using viewsFind statistics about how many base tables have how many derived tables that use these tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:42MIT License
625Number of used tablesFind statistics about how many derived tables have how many different underlying tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:43MIT License
626Subqueries of derived tables with LIMIT/FETCH/DISTINCT ON without ORDER BYFind subqueries of derived tables (views, materialized views) with the LIMIT/FETCH clause or with DISTINCT ON construct but without the ORDER BY clause. These constructs require sorting to produce a meaningful result.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-03 16:56MIT License
627Potentially missing sequence generators (based on column names and types)Find surrogate key columns that do not have an associated sequence generator. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-08 00:44MIT License
628Surrogate key columns that do not follow the naming styleFind surrogate key columns that name does not end with "id_" or start with "id_".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-16 12:19MIT License
629Surrogate key columnsFind surrogate keys. Surrogate key is a key that consist of one column, which has an integer type. The key has been declared by using PRIMARY KEY or UNIQUE constraint. The column is associated with a sequence generator (either external or internal, i.e., created by the system automatically because the column has been declared as an identity column). The column does not participate in any foreign key.GeneralINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:59MIT License
630The generator of surrogate key values can output the same value more than onceFind surrogate keys where the generator can output the same value more than once. Key values must be unique, i.e., at some point the generator will prevent adding new rows to the table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-08 00:40MIT License
631All system-defined TOAST-able typesFind system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).Generalsystem catalog base tables only2020-11-06 14:51MIT License
632Perhaps an overcomplicated constraint expression that compares the result of a Boolean expression with a Boolean valueFind table and domain CHECK constraints that compare the result of a Boolean expression with a Boolean value. If you can choose between two logically equivalent Boolean expressions choose the more simple expression.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-30 11:57MIT License
633Permitting in a column only empty strings and strings that consist of whitespace charactersFind table CHECK constraints that permit in a column only empty strings or strings that consist of only whitespace characters.Problem detectionINFORMATION_SCHEMA only2021-12-19 15:10MIT License
634Perhaps an unnecessary default value (the empty string or a string that consists of only whitespace) of a base table column/domainFind table columns and domains with the default value that is the empty string or a string that consists of only whitespace (for instance, newlines, spaces).Problem detectionINFORMATION_SCHEMA only2021-03-20 11:42MIT License
635CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the columnFind table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces).Problem detectionINFORMATION_SCHEMA only2022-10-31 10:19MIT License
636Inconsistency between the type and the default value of a column (date and timestamp values)Find table columns with timestamp/date types that data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
637Inconsistency between the type and the default value of a column (time values)Find table columns with time types, which data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
638Too generic names (table constraints)Find table constraints (constraints that are associated directly with the table) that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name.Problem detectionsystem catalog base tables only2023-01-08 10:40MIT License
639A non-parameterized table function instead of a viewFind table functions that do not have any parameters. Prefer simpler and more portable solutions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-03 21:16MIT License
640Table functions with OFFSETFind table functions that use OFFSET. OFFSET method is a common way for implementing pagination.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:13MIT License