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...
821Unbalanced bracketsWrite expressions correctly. Find code fragments that have unbalanced brackets, i.e., the number of opening brackets is not the same as the number of closing brackets.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 16:02MIT License
822Unique index definition instead of a key declarationFind cases where a unique constraint (that is not case-insensitive or partial, i.e., applies only to certain rows) has been enforced by using a CREATE UNIQUE INDEX statement instead declaring a PRIMARY KEY, UNIQUE, or EXCLUDE constraint. You should try to work on as high level of abstraction as possible. According to the ANSI-SPARC Architecture indexes are a part of internal database schema whereas constraints are a part of conceptual schema, i.e., at the higher level of abstraction.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
823Unnamed columns in routinesFind user-defined routines that contain a SQL statement that does not give the name to a column in a SQL statement.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-22 00:04MIT License
824Unnamed parametersFind unnamed parameters in PL/PGSQL routines that do not declare aliases for parameters and in SQL routines. Avoid unnamed parameters because dependency on position in case of referencing the parameters makes evolving the code more difficult. In case of unnamed parameters - if one changes the order of parameters in the routine signature, then one has to change the body of the routine in order to use correct references. The bigger is the number of parameters in a routine the more the unnamed parameters make it more difficult to understand the routine.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-15 18:16MIT License
825Unnecessary domainsDomain is a reusable artifact. Effort of its creation should be paid off by the advantages that it offers. If a domain is used in case of at most one column of a base table or even if it is used in case of more than one column but it does not specify neither a default value nor a check constraint, then there is no point of creating the domain.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
826Unnecessary privileges to use trigger functionsA user that corresponds to an application does not have to have privileges to use trigger functions. If it has these, then it violates the principle of least privilege.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
827Unnecessary usage of the numeric type in case of base table columnsFind base table columns that have type NUMERIC and the scale is 0, i.e., one can record in the column only integer values. Arithmetic operations are slower in case of the numeric type compared to an integer type. Thus, in order to record integer values, one should use columns with the type SMALLINT, INTEGER, or BIGINT instead of NUMERIC(p,0).Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
828Unnecessary usage privileges of PUBLICPostgreSQL gives by default some privileges to all the present and future database users (PUBLIC). Find usage privileges of collations, domains, foreign data wrappers, foreign servers, and sequences that have been given to PUBLIC.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-31 13:53MIT License
829Unsecure SECURITY DEFINER routinesSECURITY DEFINER routines must be secured against the malicious use of pg_temp schema. Find routines that do not explicitly set the search path or do it incorrectly (the search path is between quotation marks) and are thus potential targets of the attack. pg_temp must be the last entry in search_path. The lack of search_path is allowed only if the SQL statements in routines explicitly refer to the schemas that contain the schema objects.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-13 12:07MIT License
830Unused composite types (for table columns, typed tables, input and output parameters)Find user-defined composite types that are not used in case of any table, column, and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
831Unused domains (for base table columns and parameters)Find domains that are not used in case of any base table column and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
832Unused enumerated types (for base table columns, domains, and parameters)Find enumerated types that are not used in case of any base table column, domain, and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
833Unused foreign data wrappersFind foreign data wrappers that do not have any associated foreign servers.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
834Unused foreign serversFind foreign servers that do not have any associated foreign tables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
835Unused indexesFind indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-19 00:23MIT License
836Unused indexes (2)Find indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-19 00:28MIT License
837Unused named input parametersFind named input parameters that are not referenced in the routine body. All the parameters that are presented in the routine signature declaration must be used in its body. Otherwise these are dead code elements.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 13:03MIT License
838Unused schemasDo not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
839Unused trigger functionsDo not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
840Updatable views that do not have WITH CHECK OPTION constraintFind updatable views that do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented.Problem detectionINFORMATION_SCHEMA only2023-10-29 10:33MIT License