Catalog of PostgreSQL queries for finding information about a PostgreSQL database and its design problems

AND
AND
ANDQueries of this category provide information about the user-defined routines
ANDFrom where does the query gets its information?
AND
AND

There are 181 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
1A getter does not return a valueFind user-defined SQL and PL/pgSQL routines that do not return a value although the name suggest that it should return a value (starts with "get").Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:24MIT License
2All 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
3All table functionsFind all functions that return a set of rows.GeneralINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:39MIT License
4AND takes precedence over ORMake sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
5A 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
6A predefine character class has been incorrectly specifiedFind regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:].Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-23 12:09MIT License
7Are there enough routines that implement database operations?Find user-defined routines that implement database operations (comment refers to an operation) but show these only if there are at least eight such routines. Contracts of database operations are specified in the system analysis documentation. The contracts apply the idea of design by contract in the field of databases.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-03 20:07MIT License
8A routine is invoked only onceFind user-defined routines that are invoked by exactly one user-defined routine.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-10 17:11MIT License
9A setter does not update a tableFind user-defined non-trigger SQL and PL/pgSQL routines that name starts with "set" (but not with "setting") but do not contain a UPDATE statement.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-27 18:35MIT License
10A table has the same name as a routineFind table names that are the same as some routine name. Use different names to avoid confusion.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
11Case insensitive searchRefers to the column pg_proc.prokind and thus works starting from PostgreSQL 11. Find user-defined routines and derived tables (views/materialized views) that have a subquery with case insensitive search (by using the upper or lower function or ILIKE predicate or (?i) modifier of a regular expression pattern).GeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:55MIT License
12Coalesce/Concat need at least two argumentsFind user-defined routines and derived tables (views/materialized views) that have a subquery that contain an invocation of Coalesce or Concat function with just one argument. You should use the Coalesce and Concat functions correctly by invoking these with at least two arguments. If one invokes these functions with one argument, then the functions will return the input value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 11:49MIT License
13Comments 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
14Consistency 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
15Coverage 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
16Database 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
17Database 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
18Derived 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
19Deterministic (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
20Deterministic (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