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...
881Transform method does not returnFind user-defined SQL and PL/pgSQL routines that do not return a value although the name suggest that it should return a value (contains "_to_").Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-14 19:37MIT License
882Trigger functions with a conditional statementFind trigger functions that contain a conditional (IF or CASE) but do not contain a SELECT statement before these. The latter condition is for the reason that one cannot use a subquery in the WHEN clause. Thus, if one wants to make a query and decide the further action based on the results of the query, then one must do it within the body of the function.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-19 12:07MIT License
883Trigger is used to enforce referential integrityFind tables where user-defined (non-system) triggers are used to implement referential integrity. In addition to table name show the triggers and the number of triggers.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
884Trigger routines with TG_OP variable that are not associated with a suitable triggerAutomatically defined TG_OP variable in a trigger function has data type text. Its value is a string of INSERT, UPDATE, DELETE, or TRUNCATE telling for which operation the trigger was fired. Find the routines that according to the TG_OP value must react to a certain operation but the routine is not associated with any triggers that are fired by the operation. For instance, the routine specifies reaction to DELETE operation but the routine is not associated with any DELETE trigger.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-25 01:26MIT License
885Triggers that are used to calculate tsvector values react to a wrong set of eventsFind triggers on base tables that are used to calculate tsvector values that react to a wrong set of events, i.e., react to the DELETE event or do not react to the INSERT and UPDATE events.Problem detectionsystem catalog base tables only2023-11-07 10:14MIT License
886Triggers with arguments from the CREATE TRIGGER statementFind triggers that get an argument from the CREATE TRIGGER statement.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-22 12:35MIT License
887Triggers with SELECT (i.e., probably check data based on another table)If a trigger is used for enforcing a constraint, then it should take into account that due to the implementation of multiversion concurrency control (MVCC) in PostgreSQL, reading data does not block data modification and vice versa. Thus, there may be a need to lock the entire table or some row explicitly.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
888Triggers with the same name in different schemasFind trigger names that are used in a database in more than one schema. Different things should have different names. But here different triggers have the same name. Also make sure that this is not a duplication.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
889Triggers with the same name within the same schemaFind names of triggers that are used within the same schema more than once. Give different triggers different names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
890Tsvector values are not automatically calculatedFind base table columns with tsvector type in case of which it is not a generated column nor does the table has an associated trigger to calculate the tsvector value automatically.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 11:45MIT License
891Unbalanced 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
892Unique 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
893Unlogged tablesFind unlogged tables. These may improve the performance of INSERT operations, but with the price of possibly loosing data - an unlogged table is automatically truncated after a crash or unclean shutdown.Generalsystem catalog base tables only2020-11-06 14:51MIT License
894Unnamed 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
895Unnamed 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
896Unnecessary 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
897Unnecessary 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
898Unnecessary 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
899Unnecessary 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
900Unsecure 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