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...
341Too generic names (tables)Find the names of tables that are too generic. In SQL databases data/information is represented as values in columns. It is not a good style to use generic names like table, data, information, list etc. in the names of tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-07 20:37MIT License
342Too generic names (unique index columns)Find unique index (not associated with a constraint) columns with the names like id, identifikaator, code, kood, number, etc. The names could have underscores as the prefix or suffix. These are too generic names.Problem detectionsystem catalog base tables only2023-01-07 20:34MIT License
343Do not use approach that one size fits all (unique index columns)Find base base tables have a simple unique index (not associated with a constraint) that contains the column with the (case insensitive) name id and an integer type. In addition, the key values are generated automatically by the system by using a sequence generator.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-07 15:12MIT License
344Parameter name contains the routine nameFind parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 18:03MIT License
345Parameter name is the same as the routine nameFind parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 18:03MIT License
346Is 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
347Validation 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
348A 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
349Meaningless terms in routinesFind routines that subquery contains terms "foo", "bar", "foobar", or "baz".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:09MIT License
350Meaningless terms in derived tablesFind derived tables that subquery contains terms "foo", "bar", "foobar", or "baz".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 14:08MIT License
351One-to-one relationshipsFind one-to-one relationships between base tables. In this case the foreign key columns must have primary key or unique constraint. These tables could implement inheritance hierarchy that has been specified in the conceptual data model.Generalsystem catalog base tables only2023-01-06 13:39MIT License
352Column name contains the table nameFind columns that have the same name as the table. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-06 12:38MIT License
353Column name is the same as the table nameFind columns that have the same name as the table. The names may have different uppercase/lowercase characters. Sometimes columns with such names are used as the key columns. Make sure that the naming style is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-06 12:38MIT License
354Sometimes regexp_like, sometimes ~Find as to whether you sometimes use regexp_like function and sometimes ~ operator. These implement the same functionality. regexp_like function that was added to PostgreSQL 15 and provides the same functionality as ~ and ~* operators. Try to be consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-13 13:23MIT License
355Table check constraints with regular expressionsFind all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column and use a regular expression. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).GeneralINFORMATION_SCHEMA only2022-12-13 12:47MIT License
356Too wide derived (dependent) tableFind derived tables (views, materialized views) that are based on more than five tables and that have more than 15 columns. This view might produce "a denormalized world view" where all the data is together in one table and applications make queries based on this single view to fulfill their specific tasks. Such view does not follow the separation of concerns principle.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-13 12:34MIT License
357FOR UPDATE in derived tablesFind derived tables that subquery uses FOR UPDATE construct. Reading a data element shouldn't block other read operations of the same element. Thus, you shouldn't use exclusive locking command in a view.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-12 11:11MIT License
358ROW level BEFORE UPDATE triggers that do not return the new rowFind row level BEFORE UPDATE triggers that do not return the new row version. Exclude triggers that raise WARNING/EXCEPTION.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-08 15:59MIT License
359CHECK constraints that perhaps incorrectly consider 'infinity' and '-infinity' special valuesSuch special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. No value can be bigger than infinity or smaller than -infinity. If the check constraint cheks that a value must be bigger than -infinity or smaller than infinity, then it does not restrict (almost) anything.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-07 20:13MIT License
360INFORMATION_SCHEMA is missingMake sure that you do not drop INFORMATION_SCHEMA schema. In this case most of the design checking queries will not work. This schema automatically exists in all databases.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-07 19:07MIT License