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...
761Invocation of a system-defined routine without providing any argumentsFind user-defined routines that contain an invocation of a system-defined function without providing any argument. The query considers all aggregate functions as well as some popular scalar functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-22 13:00MIT License
762Unnamed 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
763User-defined routines that read dataFind user-defined routines that contain SELECT … FROM or PERFORM … FROM operations. PostgreSQL uses multiversion concurrency control (MVCC). Therefore, SELECTs do not block modifications and vice versa. One has to take steps to achieve correct behaviour of data access code. In addition, one should not ask data with multiple queries if it is possible to achieve the result with only one query.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-21 15:00MIT License
764Updating or deleting data in a routine without restricting rowsFind user-defined routines that contain UPDATE or DELETE statement but do not contain any WHERE clause, meaning that at least one UPDATE or DELETE operation influences all the rows of a table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-29 13:21MIT License
765Consistency 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
766Explicit locking is missing (2)Find user-defined routines that have a subquery in a DELETE or UPDATE statement without the FOR UPDATE clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-06 12:15MIT License
767Are 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
768Incorrect reference to a system-defined function in the routine bodyFind user-defined routines that possibly use incorrect name of a system-defined function (currenttimestamp (correct is current_timestamp), currentdate (correct is current_date), currenttime (correct is current_time), local_time (correct is localtime), local_timestamp (correct is localtimestamp),localdate (there is no such function),local_date (there is no such function), sessionuser (correct is session_user), ucase (correct is upper), lcase (correct is lower)). The problem can arise only if the routine uses dynamic SQL. In case of static SQL the DBMS checks the SQL statemen at the creation time and finds out that for instance, SELECT Count(*) AS cnt FROM Emp WHERE hiredate<=currentdate; is incorrect statement because currentdate is not a function name and there is no column currentdate in the table Emp.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:48MIT License
769User-defined routines that use dynamic SQL to execute data manipulation statementsFind user-defined routines that use dynamic SQL to execute data manipulation statements (SELECT, INSERT, UPDATE, DELETE).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 12:39MIT License
770User-defined routines that use keyword DECLARE but do not declare anythingFind user-defined routines that use keyword DECLARE but do not declare anything.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 14:47MIT License
771User-defined routines that use md5 hash for other purposes than generating test dataFind user-defined routines that use md5 hashes for the security purposes. Nowadays such hashes can be calculated too quickly and its use should be avoided at least for hashing passwords. Exclude routines that invoke both md5 function and generate_series function and are thus probably used to generate test data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-31 15:23MIT License
772Not equals check in unstandardized wayFind user-defined routines that use != operator to test as to whether two values are not equal.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-13 14:16MIT License
773Too few rounds in case of calculating the hashFind user-defined routines where gen_salt function is used with the number of rounds that is smaller than 12. The number should be adjusted based on the hardware where the system resides. Password hashing should take at least 250 ms.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-25 17:21MIT License
774Duplicate user-defined routinesFind user-defined routines with the exact duplicate body and parameters. There should not be multiple routines with exactly the same body and parameters (name, type). Having such duplicates is redundancy. Do remember that the same task can usually be solved in multiple different ways. Thus, the exact copies of routine bodies are not the only possible duplication. Moreover, it could be that different routines that solve the same task have different parameter names (but the parameters have the same types, ordinal positions, default values or the routines have different order of parameters). Thus, the query does not find all the duplications.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 11:59MIT License
775Routines with the same name and parameters in different schemasFind user-defined routines with the same name and parameters (including the order of parameters) in different schemas.GeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:11MIT License
776All rulesFind user-defined rules for rewriting data manipulation language statements. Rules should be used only for the tasks that cannot be achieved in a declarative manner, i.e., for example, by declaring a constraint.Generalsystem catalog base tables only2023-12-22 12:30MIT License
777Is does not return a booleanFind user-defined SQL and PL/pgSQL non-trigger routines that do not return a truth value (for instance, returns an integer or does not return a value at all) although the name suggest that it should return a truth value (TRUE or FALSE).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:25MIT License
778Transform 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
779A 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
780Validation method does not confirmFind 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 "validate" or "check").Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:25MIT License