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...
741Useless type indication (2)Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:55MIT License
742User-defined derived tablesFind user-defined views and materialized views. Pay attention to the outer join operations. One should use these if and only if there is a real need for them. Otherwise they just reduce performance. On the other hand, pay attention that outer join is used where it is logically needed.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-11 15:23MIT License
743User-defined non-trigger routines without parametersFind user-defined non-trigger routines with no parameters.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-03 20:05MIT License
744User-defined non-trigger SQL and PL/pgSQL routinesFind the non-trigger SQL and PL/pgSQL routines in non-systemic schemas.GeneralINFORMATION_SCHEMA+system catalog base tables2021-12-23 02:40MIT License
745User-defined routine execution privilege has been granted to PUBLICYou should follow the principle of least privilege and thus not have in your database user-defined routines that execution privilege is granted to PUBLIC, i.e., to all the database users now and in the future. By default, PostgreSQL gives routine execution privileges to PUBLIC.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
746User-defined routines that have the same name as some system-defined routine.Avoid creating user-defined routines that have the same name as some system-defined routine because it may cause confusion.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
747User-defined routines that implement UPSERT operationFind user-defioned routines that implement UPSERT operation. Make sure that it is consistent with the contracts of database operations.GeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 17:02MIT License
748User-defined routines that produce a temporary tableFind user user-defined routines that produce a temporary tableGeneralINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:25MIT License
749User-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
750User-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
751User-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
752User-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
753User-defined routines that use positional references to parametersUse parameter names instead of positional references to improve code evolvability.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 13:18MIT License
754User-defined routines that use xmin hidden columnFind routines that contain a UPDATE or a DELETE statement that search condition refers to the xmin column. If one uses optimistic approach for dealing with the concurrent modifications of data, then xmin values should be presented by views and used in routines that modify or delete rows.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:30MIT License
755User-defined routines with dynamic SQLFind routines that use dynamic SQL. Make sure that dynamic SQL is indeed needed, i.e., the task cannot be solved with static SQL. Make sure that the routine is protected against attacks that use SQL injection method.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:09MIT License
756User-defined routines with dynamic SQL that are potential targets of the SQL injection attackFind routines that have at least one input parameter, use dynamic SQL but do not escape the input arguments at all.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:58MIT License
757User-defined routines with the same parameters (same name and type) regardless of the order of parametersFind routines with the same parameters (same name and type) regardless of the order of parameters. Make sure that there is no accidental duplication. The query helps users to group together routines that probably have related tasks.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
758Username is not uniqueFind textual columns that potentially contain usernames (including columns that potentially contain e-mail addresses) that do not have a unique constraint or a unique index that involves only this column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
759Using AFTER triggers to enforce constraintsDo not let the system to do extra work. Checking a constraint with an AFTER trigger means that the trigger procedure will be executed after the data modification and if the check fails, then the system has to do extra work to roll back the changes.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
760Using BEFORE triggers to log data changesDo not let the system to do extra work. Logging changes with a BEFORE trigger means extra work for rolling back the changes in case the logged data modification fails.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License