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...
201Precise comparison with pattern matching in CHECK constraintsFind CHECK constraints that use precise comparison (= or <>) with a regular expression or LIKE pattern.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 17:13MIT License
202Base table columns permitting URLs without a protocolFind non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 13:13MIT License
203Inconsistent field sizes of columns for addressesFind as to whether columns for holding e-mail addresses, phone numbers, ip addresses, zip codes, ordinary addresses, or file addresses have inconsistent field sizes across tables.Problem detectionINFORMATION_SCHEMA only2023-11-01 12:53MIT License
204Inconsistent referencing to character classes (digits)Find as to whether different syntaxes (e.g., 0-9 vs [[:digit:]] or \d) are used to refer to the character class of digits within the same database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 11:57MIT License
205Inconsistent referencing to character classes (shorthand vs long name)Find as to whether different syntaxes (e.g., \s vs [[:space:]]) are used to refer to character classes within the same database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 11:57MIT License
206All identifying relationshipsFind all non-identifying relationships where the foreign key (a set of columns) is a subset of a uniqueness constraint (primary key, unique, or exclude constraint).Generalsystem catalog base tables only2023-11-01 11:32MIT License
207All non-identifying relationshipsFind all non-identifying relationships where the foreign key (a set of columns) is not a subset of any uniqueness constraint (primary key, unique, or exclude constraint).Generalsystem catalog base tables only2023-11-01 11:31MIT License
208All table functionsFind all functions that return a set of rows.GeneralINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:39MIT License
209Routines that use old syntax for limiting rowsFind PL/pgSQL routines and SQL routines that do not have SQL-standard body that use unstandardized LIMIT clause instead of standardized FETCH FIRST n ROWS clause. The query excludes routines that are a part of an extension.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:34MIT License
210Inconsistent use of casting syntax in routinesFind as to whether PL/pgSQL routines and SQL routines that do not have SQL-standard body use different syntax for casting (cast function vs :: operator).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:33MIT License
211PL/pgSQL functions without the RETURN clauseThe return value of a function cannot be left undefined. If control reaches the end of the top-level block of the function without hitting a RETURN statement, a run-time error will occur. This restriction does not apply to functions with output parameters and functions returning void, however. In those cases a RETURN statement is automatically executed if the top-level block finishes. It also does not apply to trigger functions that only task is to raise an exception.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:13MIT License
212Updatable 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
213Updatable views that have not been turned to read onlyFind views that are theoretically updatable but do not have INSTEAD OF trigger or DO INSTEAD NOTHING rule to prevent data modifications through the view.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 10:20MIT License
214ON DELETE CASCADE is probably not needed (based on the relationship type)Find foreign key constraints that implement a non-identifying relationship type and have ON DELETE CASCADE compensating action. If the identity of the parent table is not a part of the identity of the child table, then there is a non-identifying relationship type and most probably the foreign key should not have ON DELETE CASCADE.Problem detectionsystem catalog base tables only2023-10-28 18:38MIT License
215Inconsistent means of concatenation in various database objectsFind as to different database objects use different means to concatenate text (format function, concat function, concat_ws function, || operator).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-28 17:36MIT License
216Overlapping non-function based indexes that have the same leading column but with different operator classFind non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.Generalsystem catalog base tables only2023-10-28 15:05MIT License
217Non-updatable views with DO INSTEAD NOTHING rulesFind non-updatable views that have a DO INSTEAD NOTHING rule. The rule is used to prevent updates. However, the view is aniway non-updatable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-28 13:01MIT License
218The size of base tables and their indexesFind the size of base tables without indexes, size of the indexes of the table, total size of the table (including its indexes) and percentage of the index size from the total size. If the size of indexes of a table is relatively high, then check as to whether all the indexes are needed.Generalsystem catalog base tables only2023-10-27 20:38MIT License
219Inconsistent use of gratuitous context in the names of non-foreign key and non-candidate key columnsFind the number of names on base table columns that are not a part of a candidate key and a foreign key and that contain the name of the table. Find the number of names on base table columns that are not a part of a candidate key and a foreign key and that do not contain the name of the table. Make sure that table name is used consistently in the column names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-26 20:25MIT License
220Base tables that have a surrogate key and do not have any uniqueness constraintsA surrogate key is a key that consist of one column. The values of this column do not have any meaning for the user and the system generates the values (integers) automatically. In case of defining a surrogate key in a table it is a common mistake to forget declaring existing natural keys in the table. The query discards tables with only one column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-26 17:47MIT License