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.

#261. Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns)

INFORMATION_SCHEMA only

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

#262. Columns of base tables that hold truth values but do not have a default value (Boolean columns)

INFORMATION_SCHEMA only

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

#263. Potentially missing PRIMARY KEY or UNIQUE constraints (based on column names)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables that name refers to the possibility that it contains unique values but the column does not belong to any PRIMARY KEY/UNIQUE constraint. If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint.

Problem detection License: MIT (opens in new tab)

#264. Perhaps the type of a base table column should be an integer type (based on column names)

INFORMATION_SCHEMA only

Find columns of base tables where the name of the column has prefix or suffix "id" or has the name "id" but the column does not have an integer type or uuid type. A convention is to use the phrase "id" in the names of surrogate key columns.

Problem detection License: MIT (opens in new tab)

#265. Columns of derived tables that name has been given by the system

system catalog base tables only

Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.

Problem detection License: MIT (opens in new tab)

#266. Columns of derived tables that name has been given by the system (2)

system catalog base tables only

Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.

Problem detection License: MIT (opens in new tab)

#267. Names of the columns of derived tables that have been given by the system

INFORMATION_SCHEMA+system catalog base tables

Find columns of derived tables that name has been given by the system. The creators of the table should specify the name themselves to avoid ugly names and nasty surprises.

Problem detection License: MIT (opens in new tab)

#268. Names of columns that hold personal names but do not take into account cultural diversity

system catalog base tables only

Find columns of tables (base tables, views, materialized views, foreign tables) that have the name first_name or last_name. Such column names do not take into account that different cultures use different personal name components and the number of possible components is more than two. If in a culture, the surname is presented before the given name, then the column names causes confusion.

Problem detection License: MIT (opens in new tab)

#269. Inconsistent naming of comment columns

INFORMATION_SCHEMA+system catalog base tables

Find columns of tables that start with the word comment or komment but end differently (excluding numbers). Return result only if there is more than one naming variant of such columns in the database. For instance, a column has the name "comment" but another "comments".

Problem detection License: MIT (opens in new tab)

#270. Potentially a classifier is missing (based on field sizes)

INFORMATION_SCHEMA+system catalog base tables

Find columns that are not covered by a primary key, unique, and foreign key constraint but have a textual type with the maximum field size 3 or less.

General License: MIT (opens in new tab)

#271. Columns defined in a subtable

INFORMATION_SCHEMA+system catalog base tables

Find columns that have been added to a subtable, i.e., these were not defined in its immediate supertable.

General License: MIT (opens in new tab)

#272. Duplicate NOT NULL constraints

INFORMATION_SCHEMA+system catalog base tables

Find columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises.

Problem detection License: MIT (opens in new tab)

#273. Column name contains the table name

INFORMATION_SCHEMA+system catalog base tables

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

General License: MIT (opens in new tab)

#274. Column name is the same as the table name

INFORMATION_SCHEMA+system catalog base tables

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

General License: MIT (opens in new tab)

#275. Perhaps the type of a base table column/domain should be SMALLINT (based on classifiers)

INFORMATION_SCHEMA only

Find columns that name points to the possibility that values in this are classifier codes. The column has a numeric type but it is not SMALLINT. Usually each classifier type has so few values that type SMALLINT would be appropriate.

Problem detection License: MIT (opens in new tab)

#276. Password is unique

INFORMATION_SCHEMA+system catalog base tables

Find columns that potentially contains passwords and that participate in a unique constraint or index

Problem detection License: MIT (opens in new tab)

#277. Storing file content in the database

INFORMATION_SCHEMA only

Find columns that probably store content of files in the database.

General License: MIT (opens in new tab)

#278. NOT NULL constraint via CHECK instead of NOT NULL constraint

INFORMATION_SCHEMA only

Find columns where the NOT NULL constraint has been added with the help of an explicit CHECK constraints instead of a NOT NULL constraint. One should note that internally NOT NULL constraints are treated as a kind of CHECK constraints. Nevertheless, the design should be consistent (i.e., NOT NULL is enforced with the same way in different places).

Problem detection License: MIT (opens in new tab)

#279. Precision of a timestamp or a time column is too big

INFORMATION_SCHEMA only

Find columns with a timestamp or a time type where the precision (the permitted maximum number of fractional sections) is bigger than the precision in the default value of the column.

Problem detection License: MIT (opens in new tab)

#280. Columns with BYTEA or OID type

INFORMATION_SCHEMA+system catalog base tables

Find columns with BYTEA or OID type. These columns are potentially meant for storing large objects. Each columns should have the most appropriate data type.

General License: MIT (opens in new tab)
# Name Goal (sorted ascending) Type Data source Last update License Actions
261 Columns 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 detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
262 Columns 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 detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
263 Potentially missing PRIMARY KEY or UNIQUE constraints (based on column names) Find columns of base tables that name refers to the possibility that it contains unique values but the column does not belong to any PRIMARY KEY/UNIQUE constraint. If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
264 Perhaps the type of a base table column should be an integer type (based on column names) Find columns of base tables where the name of the column has prefix or suffix "id" or has the name "id" but the column does not have an integer type or uuid type. A convention is to use the phrase "id" in the names of surrogate key columns. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
265 Columns of derived tables that name has been given by the system Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
266 Columns of derived tables that name has been given by the system (2) Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
267 Names of the columns of derived tables that have been given by the system Find columns of derived tables that name has been given by the system. The creators of the table should specify the name themselves to avoid ugly names and nasty surprises. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
268 Names of columns that hold personal names but do not take into account cultural diversity Find columns of tables (base tables, views, materialized views, foreign tables) that have the name first_name or last_name. Such column names do not take into account that different cultures use different personal name components and the number of possible components is more than two. If in a culture, the surname is presented before the given name, then the column names causes confusion. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
269 Inconsistent naming of comment columns Find columns of tables that start with the word comment or komment but end differently (excluding numbers). Return result only if there is more than one naming variant of such columns in the database. For instance, a column has the name "comment" but another "comments". Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
270 Potentially a classifier is missing (based on field sizes) Find columns that are not covered by a primary key, unique, and foreign key constraint but have a textual type with the maximum field size 3 or less. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
271 Columns defined in a subtable Find columns that have been added to a subtable, i.e., these were not defined in its immediate supertable. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
272 Duplicate NOT NULL constraints Find columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
273 Column name contains the table name Find 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. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
274 Column name is the same as the table name Find 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. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
275 Perhaps the type of a base table column/domain should be SMALLINT (based on classifiers) Find columns that name points to the possibility that values in this are classifier codes. The column has a numeric type but it is not SMALLINT. Usually each classifier type has so few values that type SMALLINT would be appropriate. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
276 Password is unique Find columns that potentially contains passwords and that participate in a unique constraint or index Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
277 Storing file content in the database Find columns that probably store content of files in the database. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
278 NOT NULL constraint via CHECK instead of NOT NULL constraint Find columns where the NOT NULL constraint has been added with the help of an explicit CHECK constraints instead of a NOT NULL constraint. One should note that internally NOT NULL constraints are treated as a kind of CHECK constraints. Nevertheless, the design should be consistent (i.e., NOT NULL is enforced with the same way in different places). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
279 Precision of a timestamp or a time column is too big Find columns with a timestamp or a time type where the precision (the permitted maximum number of fractional sections) is bigger than the precision in the default value of the column. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
280 Columns with BYTEA or OID type Find columns with BYTEA or OID type. These columns are potentially meant for storing large objects. Each columns should have the most appropriate data type. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)