Filter Queries

Found 1053 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

#121. Sometimes extract, sometimes date_part

INFORMATION_SCHEMA+system catalog base tables

Find as to whether you sometimes use date_part function and sometimes extract function. These implement the same functionality.

Problem detection License: MIT (opens in new tab)

#122. Sometimes regexp_like, sometimes ~

INFORMATION_SCHEMA+system catalog base tables

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 detection License: MIT (opens in new tab)

#123. Do not use approach that one size fits all (unique index columns)

INFORMATION_SCHEMA+system catalog base tables

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 detection License: MIT (opens in new tab)

#124. Only ID primary key

INFORMATION_SCHEMA+system catalog base tables

Find base base tables have the simple primary key that contains a column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator. In addition the base table must not have any unique constraint.

Problem detection License: MIT (opens in new tab)

#125. Do not use approach that one size fits all (primary key columns)

INFORMATION_SCHEMA+system catalog base tables

Find base base tables have the simple primary key that contains the column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator.

Problem detection License: MIT (opens in new tab)

#126. Do not format comma-separated lists (based on column names)

INFORMATION_SCHEMA only

Find, based on column names, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters.

Problem detection License: MIT (opens in new tab)

#127. Do not format comma-separated lists (based on default values)

INFORMATION_SCHEMA only

Find, based on default values, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters.

Problem detection License: MIT (opens in new tab)

#128. Do not format comma-separated lists (based on user data)

INFORMATION_SCHEMA+system catalog base tables

Find, based on the data that users have recoreded in a database, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters.

Problem detection License: MIT (opens in new tab)

#129. BOOLEAN base table and foreign table columns with a CHECK constraint that involves olnly this column

INFORMATION_SCHEMA+system catalog base tables

Find base table and foreign table columns with the Boolean type that has a CHECK constraint that involves only this column. Avoid unnecessary CHECK constraints. The Boolean type contains only two values and there is nothing to check. By creating a check that determines that possible values in the column are TRUE and FALSE, one duplicates the attribute constraint (column has a type). This is a form of duplication.

Problem detection License: MIT (opens in new tab)

#130. Table constraints with the same name (constraints connected directly with a base table or a foreign table)

system catalog base tables only

Find base table and foreign table constraint names that are used in a database more than once (possibly in different schemas or in case of different types of constraints). Different things should have different names. But here different constraints have the same name. Also make sure that this is not a sign of duplication.

Problem detection License: MIT (opens in new tab)

#131. Not inherited CHECK constraints that are recreated in the immediate subtable

system catalog base tables only

Find base table CHECK constraints that have been defined as NOT INHERITED but the constraint with the same Boolean expression has been defined in the immediate subtable of the table.

Problem detection License: MIT (opens in new tab)

#132. Perhaps the type of a base table column/domain should be BOOLEAN (based on types and default values)

INFORMATION_SCHEMA only

Find base table columns and domains that have a textual type and the default value that represents a truth-value. For instance, the type of a column could be VARCHAR and the column has the default value 'TRUE'.

Problem detection License: MIT (opens in new tab)

#133. Perhaps the type of a base table column/domain should be temporal (based on default values)

INFORMATION_SCHEMA only

Find base table columns and domains that have a textual type but the default value that represents a temporal value (either a static value or invocation of a function that returns such value). Specify for each column/domain a right data type that takes into account expected values in the column/domain.

Problem detection License: MIT (opens in new tab)

#134. Base table columns where TOAST-ing strategy has been changed

system catalog base tables only

Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed so that it is different than the default strategy determined by the type. Make sure that the new strategy is optimal.

General License: MIT (opens in new tab)

#135. Base table columns where TOAST-ing strategy has been changed to plain

system catalog base tables only

Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row.

Problem detection License: MIT (opens in new tab)

#136. Base table columns for recording geographic coordinates (based on column names)

INFORMATION_SCHEMA only

Find base table columns that are according to the name meant for recording coordinates.

General License: MIT (opens in new tab)

#137. Base table columns for recording geographic coordinates that do not have a suitable type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point).

Problem detection License: MIT (opens in new tab)

#138. Candidate key columns that have a static default value

INFORMATION_SCHEMA+system catalog base tables

Find base table columns that are covered by a primary key or a unique constraint and that probably have a static default value.

Problem detection License: MIT (opens in new tab)

#139. Columns for registration and update times

INFORMATION_SCHEMA only

Find 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.

General License: MIT (opens in new tab)

#140. Base table column of surrogate key values does not have an integer data type (based on column names)

INFORMATION_SCHEMA+system catalog base tables

Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid.

Problem detection License: MIT (opens in new tab)
# Name Goal (sorted ascending) Type Data source Last update License Actions
121 Sometimes extract, sometimes date_part Find as to whether you sometimes use date_part function and sometimes extract function. These implement the same functionality. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
122 Sometimes 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 detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
123 Do 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 detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
124 Only ID primary key Find base base tables have the simple primary key that contains a column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator. In addition the base table must not have any unique constraint. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
125 Do not use approach that one size fits all (primary key columns) Find base base tables have the simple primary key that contains the column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
126 Do not format comma-separated lists (based on column names) Find, based on column names, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
127 Do not format comma-separated lists (based on default values) Find, based on default values, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
128 Do not format comma-separated lists (based on user data) Find, based on the data that users have recoreded in a database, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
129 BOOLEAN base table and foreign table columns with a CHECK constraint that involves olnly this column Find base table and foreign table columns with the Boolean type that has a CHECK constraint that involves only this column. Avoid unnecessary CHECK constraints. The Boolean type contains only two values and there is nothing to check. By creating a check that determines that possible values in the column are TRUE and FALSE, one duplicates the attribute constraint (column has a type). This is a form of duplication. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
130 Table constraints with the same name (constraints connected directly with a base table or a foreign table) Find base table and foreign table constraint names that are used in a database more than once (possibly in different schemas or in case of different types of constraints). Different things should have different names. But here different constraints have the same name. Also make sure that this is not a sign of duplication. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
131 Not inherited CHECK constraints that are recreated in the immediate subtable Find base table CHECK constraints that have been defined as NOT INHERITED but the constraint with the same Boolean expression has been defined in the immediate subtable of the table. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
132 Perhaps the type of a base table column/domain should be BOOLEAN (based on types and default values) Find base table columns and domains that have a textual type and the default value that represents a truth-value. For instance, the type of a column could be VARCHAR and the column has the default value 'TRUE'. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
133 Perhaps the type of a base table column/domain should be temporal (based on default values) Find base table columns and domains that have a textual type but the default value that represents a temporal value (either a static value or invocation of a function that returns such value). Specify for each column/domain a right data type that takes into account expected values in the column/domain. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
134 Base table columns where TOAST-ing strategy has been changed Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed so that it is different than the default strategy determined by the type. Make sure that the new strategy is optimal. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
135 Base table columns where TOAST-ing strategy has been changed to plain Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
136 Base table columns for recording geographic coordinates (based on column names) Find base table columns that are according to the name meant for recording coordinates. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
137 Base table columns for recording geographic coordinates that do not have a suitable type (based on column names) Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
138 Candidate key columns that have a static default value Find base table columns that are covered by a primary key or a unique constraint and that probably have a static default value. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
139 Columns for registration and update times Find 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. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
140 Base table column of surrogate key values does not have an integer data type (based on column names) Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)