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...
141CHECK 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
142CHECK constraints that use non-deterministic functionsDiscover incorrect usage of non-deterministic functions in CHECK constraints. Find base table columns and foreign table columns that have a CHECK constraint that refers to a non-deterministic function that returns current date/time/timestamp.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
143CHECK constraints with IS NULLFind CHECK constraints to one column (associated with a base table directly or through domain) that check that the value is missing (IS NULL). Write as simple constraint definitions as possible. By default columns are optional, i.e., they permit NULLs. NULL in a column means that checking of a CHECK constraint on the column results with UNKNOWN. CHECK constraints permit rows in case of which checking results with TRUE or UNKNOWN. In case of a CHECK constraint there is no need to check separately that a value in the column could be missing, i.e., be NULL. Thus, for instance, instead of writing CHECK (price>0 OR price IS NULL) write CHECK (price>0).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
144CHECK constraints with the cardinality bigger than oneFind multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger.Generalsystem catalog base tables only2023-12-25 12:38MIT License
145CHECK constraints with the cardinality bigger than one that involve the same set of columnsCHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.Generalsystem catalog base tables only2023-12-25 12:39MIT License
146CHECK constraint with pattern matching on non-textual columnsFind base table and foreign table columns that do not have a textual type but have a single-column check constraint that uses pattern matching. The use of a regular expression, a LIKE clause, or a SIMILAR TO clause in order to constrain values in a non-textual column points to the incorrect selection of operator or column data type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
147CHECKs are associated with a column instead of the domain of the columnFind simple check constraints (involve one column) that are associated with a base table column instead of the domain of the column. Common checks of data in columns that share the same domain should be described at the level of domain not at the level of columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
148Coalesce/Concat need at least two argumentsFind user-defined routines and derived tables (views/materialized views) that have a subquery that contain an invocation of Coalesce or Concat function with just one argument. You should use the Coalesce and Concat functions correctly by invoking these with at least two arguments. If one invokes these functions with one argument, then the functions will return the input value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 11:49MIT License
149Column 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
150Column 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
151Column names that make joining more difficult (foreign key column name contains the table name)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different but the difference comes from the fact that the foreign key column name starts or ends with the table name. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-12 10:26MIT License
152Column names that make joining tables more difficultFind foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
153Column names that make joining tables more difficult (quite similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is between two and four characters. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
154Column names that make joining tables more difficult (very similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is one character. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
155Columns defined in a subtableFind columns that have been added to a subtable, i.e., these were not defined in its immediate supertable.GeneralINFORMATION_SCHEMA+system catalog base tables2021-01-02 03:22MIT License
156Columns for registration and update timesFind base table columns that based on the names and data types are meant for registering registration time or update time. Make sure that the columns have the same properties.GeneralINFORMATION_SCHEMA only2023-11-26 16:51MIT License
157Columns of base tables that hold truth values but do not have a default value (Boolean columns)Find columns of base tables that have type BOOLEAN but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. Often it should be possible to select one of these as the default value of a column that has BOOLEAN type.Problem detectionINFORMATION_SCHEMA only2023-11-09 13:14MIT License
158Columns of base tables that hold truth values but do not have a default value (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It could be possible to select one of these as the default value in case of the columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:08MIT License
159Columns of base tables that hold truth values but do not restrict the permitted values (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a have a check constraint. The constraint should restrict the permitted values with values that represent truth values TRUE and FALSE.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:07MIT License
160Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns)Find columns of base tables that have type BOOLEAN. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.Problem detectionINFORMATION_SCHEMA only2023-11-09 16:39MIT License