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...
661Table, routine, and usage privileges that have been granted to a superuserFind table, routine, and usage privileges that have been granted to a superuser. Superuser can do anything in the database and thus does not need the privileges. The result is a sign that perhaps the executed GRANT statements were incorrect (wrong username) or the grantee later got superuser status (that it shouldn't have).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
662Tables without columnsDo not have in a database elements that are not useful. PostgreSQL permits tables with no columns. Such tables can be used to implement Boolean variables (tables TABLE_DEE and TABLE_DUM). On the other hand, such tables might be a result of database evolution, where developers have not noticed that they have dropped all the columns of a table or have not noticed that they have created such a table in the first place.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
663Tables with the same name in different schemasFind tables with the same name in different schemas. Make sure that this is not a duplication.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-10 15:40MIT License
664Temporal function in a simple check constraint is inconsistent with the column typeFind base table columns with a check constraint that refers to a temporal function (current_timestamp, localtimestamp, current_date, or now) that return type is inconsistent with the data type of the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-08 21:43MIT License
665Textual columns that have a secondary index but the operator class for the column does not support pattern matchingFind indexed textual columns where the indexing does not consider the possibility of pattern-based search. Such columns do not have an index where the used operator class makes the index suitable for use by queries involving pattern matching expressions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 11:52MIT License
666TG_ARGV is missingWrite correct code. If you pass arguments to a trigger function, then the function should use the arguments. TG_ARGV[]: "Data type array of text; the arguments from the CREATE TRIGGER statement. The index counts from 0. Invalid indexes (less than 0 or greater than or equal to tg_nargs) result in a null value." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
667The expression of a simple check constraint that is associated directly with a column needs type conversionFind check constraints that involve one column and are associated directly with a table where the Boolean expression invokes an operation that does not match with the data type of the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
668The generator of surrogate key values can output the same value more than onceFind surrogate keys where the generator can output the same value more than once. Key values must be unique, i.e., at some point the generator will prevent adding new rows to the table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-08 00:40MIT License
669The generic names (columns) (aggregate view)Find the too generic column names and the number of their occurrences.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-15 10:34MIT License
670The generic names (columns) (aggregate view)(2)Find the number of too generic base table and view column names. Do not differentiate between base table and view columns to determine what name is generic.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-01-18 16:42MIT License
671The longest names of database objectsFind the TOP 3 longest (identifiers) names of user-defined objects.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:22MIT License
672The longest names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the TOP 3 longest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:09MIT License
673The name of the routine does not match with the action of the routineFind user-defined non-trigger SQL and PL/pgSQL routines where the beginning of the name of the routine indicates a certain action inside the routine (INSERT, UPDATE, or DELETE) but there is no such statement in the routine body.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-19 14:37MIT License
674The number and percentage of different names of database objectsNames should be expressive. Find the number of different names used in a database as well as the number of named database objects, and the percentage of different names from all the names. Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects and compare it with the total number of database objects. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:12MIT License
675The number and percentage of different names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Different objects should have different names. The smaller the percentage the less descriptive are the names in the database. Find the number of different names (identifiers) of user-defined database objects by the object type and compare it with the total number of database objects with this type. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-16 15:38MIT License
676The number of columns based on table typeFind the total number of columns in the different types of tables as well as average number of columns in the tables as well as minimal and maximal number of columns.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-11-10 14:12MIT License
677The number of commented routinesFind the number of commented routines based on the way how the comments have been added (as a COMMENT object or as a comment in the routine body).Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 20:49MIT License
678The number of constraints by schema, by type, and in totalFind the number of constraints in different schemas. The number of constraints in a database gives an indication about the state of enforcing constraints at the database level.Sofware measureINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
679The number of derived table columns with an array, a user-defined, XML, JSON, or JSONB typeFind the number of derived table columns with json, xml, array, or user-defined types. Such columns may contain data that has been aggregated/composed based on values in base tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:22MIT License
680The number of names of database objects by the number of subcomponents in the names"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the number of names (identifiers) of user-defined database objects by the number of subcomponents in the names. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:02MIT License