Filter Queries

Found 997 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.

# Name Goal Type Data source Last update License
381 Foreign key column has a default value that is not present in the parent table Find foreign key columns that have a default value that is not present in the parent table. Identify default values that cause violations of the referential constraints. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
382 Foreign key columns that are associated with a sequence generator Find foreign key columns that are associated with a sequence generator. Foreign key values are selected amongst the values that are registered as corresponding primary key/unique key values. Values in the foreign key columns are not directly generated by the system. These values might be system generated indirectly - generated when a row is added to the primary (parent) table. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-08 00:42 MIT License View
383 Foreign key columns that do not have an integer or varchar type Find foreign key columns that do not have smallint, integer, bigint, or varchar(n) type. These are the most commonly used types in case of key/foreign key columns. Although the use of other types would be perfectly legal as well, make sure that you have selected the best possible data type for each and every column. General INFORMATION_SCHEMA+system catalog base tables 2020-11-16 10:14 MIT License View
384 Foreign key columns that have no index Find foreign key columns that do not have an index. Foreign key columns are often used for performing join operations. It is useful to index such columns. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
385 Foreign key references a non-key (has optional columns) Find foreign key constraints that referenced column is optional. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-10 12:12 MIT License View
386 Foreign servers without user mappings Find foreign servers that do not have any associated user mappings. "A user mapping typically encapsulates connection information that a foreign-data wrapper uses together with the information encapsulated by a foreign server to access an external data resource." Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View
387 FOR UPDATE in derived tables Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2022-12-12 11:11 MIT License View
388 FOR UPDATE is not allowed with aggregate functions Implement explicit locking correctly. Instead of writing, for instance, SELECT Count(*) AS cnt FROM person WHERE person_id=1 FOR UPDATE; one has to write SELECT person_id FROM person WHERE person_id=1 FOR UPDATE; Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 11:23 MIT License View
389 FOR UPDATE is not needed if there is no FROM clause in the SELECT statement Find routines that use SELECT … FOR UPDATE without selecting rows from a specific table. For instance: SELECT 'text' AS v FOR UPDATE; Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-05 14:10 MIT License View
390 Frequency of column name lengths based on the table type Find in case of base tables, materialized views, and views the number of columns based on the length of the column name. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2022-11-22 14:43 MIT License View
391 Frequency of lengths of the names of database objects "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find how many names (identifiers) of database objects there are with different lengths. The values could be used to compare different databases. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2024-12-21 16:39 MIT License View
392 Frequency of name components of database objects "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find, what are the most popular components of the names (identifiers) of user-defined database objects, assuming, that the separator of the components is "_". Sofware measure INFORMATION_SCHEMA+system catalog base tables 2024-12-21 16:50 MIT License View
393 Frequency of table name lengths based on the table type Find in case of base tables, materialized views, and views the number of tables based on the length of the table name. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2022-11-23 01:09 MIT License View
394 Frequent names of database objects "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the names (identifiers) of user-defined database objects that occur at least twice as frequently as a name occurs in average. Also make sure that there is no duplication in play. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2024-12-21 16:49 MIT License View
395 Frequent names of database objects by object type "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the names (identifiers) of user-defined database objects that occur at least twice as frequently as a name occurs in average in case of the particular type of database objects. Also make sure that there is no duplication in play. Sofware measure INFORMATION_SCHEMA+system catalog base tables 2024-12-21 17:24 MIT License View
396 Full text search columns that have no gin or gist index Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index. These are the preferred index types for text search. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-11-07 09:22 MIT License View
397 Full text search columns with other type of index than gin or gist index Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index but have another type of index (e.g., b-tree). Gin and Gist are the preferred index types for text search. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-11-07 09:22 MIT License View
398 Function in a function-based index of a column is different from the function that is used in the subquery of a derived table Find cases where the function of a function-based index of a column is different from the function that is used in the query in a derived table based on the column. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View
399 Function in a function-based index of a column is different of the function that is used in the query in a routine based on the column Create appropriate indexes to speed up queries. If you apply a function to a column in a query, then create a function-based index based on the function to the column. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 17:26 MIT License View
400 Functions that have transactional control Find functions that contain transactional control statements (BEGIN, START TRANSACTION, COMMIT, ROLLBACK, SAVEPOINT) in their body. PostgreSQL does not permit transaction control in functions. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 10:50 MIT License View