Filter Queries

Found 1077 queries.

Page 32 of 54
  • 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 the relatively small amount of data in the system catalog of a database.

#621. Names of database objects with perhaps too many subcomponents (terms)

INFORMATION_SCHEMA+system catalog base tables

"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) The number of subcomponents (terms) should not be too big. Find the names (identifiers) of user-defined database objects that perhaps contain too many subcomponents, assuming, that the separator of the components is "_".

Problem detection License: MIT (opens in new tab)

#622. Names of database objects with perhaps too many subcomponents (terms) that consist of only consonants

INFORMATION_SCHEMA+system catalog base tables

Find names of database objects where the number of subcomponents (terms) that consist of only consonants is bigger than the number of subcomponents that contain at least one vowel.

Problem detection License: MIT (opens in new tab)

#623. 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)

#624. Names of triggers and rules that do not contain the table name

INFORMATION_SCHEMA+system catalog base tables

The names should contain table name in order to make the names better understandable.

Problem detection License: MIT (opens in new tab)

#625. Name starts or ends with spaces

INFORMATION_SCHEMA+system catalog base tables

Find the names of user-defined database objects (must be delimited identifiers) that start or end with spaces.

Problem detection License: MIT (opens in new tab)

#626. No need to use to_date or to_timestamp function

INFORMATION_SCHEMA+system catalog base tables

Find expressions where a date literal with the ISO format is converted to date/timestamp by using to_date or to_timestamp function.

Problem detection License: MIT (opens in new tab)

#627. Non-foreign key columns that have no associated CHECK constraints

INFORMATION_SCHEMA only

Find what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing.

Problem detection License: MIT (opens in new tab)

#628. Non-foreign key indexes that have been named as foreign key indexes

INFORMATION_SCHEMA+system catalog base tables

Find indexes that are not on a foreign key column but the name of the index contains ixfk or idxfk.

Problem detection License: MIT (opens in new tab)

#629. Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not

INFORMATION_SCHEMA+system catalog base tables

Find non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent.

Problem detection License: MIT (opens in new tab)

#630. Non-native data types for network addresses

INFORMATION_SCHEMA only

This query identifies base table columns intended to store IP or network addresses that are not using PostgreSQL's native inet data type. It locates these columns by searching for specific English and Estonian naming patterns (such as 'ip', 'network', 'addr', or 'aadr'). Storing network addresses as generic text is an anti-pattern, as the inet type provides built-in validation, specialized network functions, and efficient indexing.

Problem detection License: MIT (opens in new tab)

#631. Non-predefined character classes must not be between double square brackets

INFORMATION_SCHEMA+system catalog base tables

Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'.

Problem detection License: MIT (opens in new tab)

#632. Non-updatable views that have data modification privileges

INFORMATION_SCHEMA+system catalog base tables

Be precise and do not give impossible privileges.

Problem detection License: MIT (opens in new tab)

#633. No-operation routines with static return values

INFORMATION_SCHEMA+system catalog base tables

This query identifies SQL routines that are functionally equivalent to a no-operation (no-op) instruction, meaning their sole operation is to return either a constant literal or an unmodified input parameter. Such routines provide no transformation or logic. They are typically superfluous and may represent placeholder code from early development, refactoring artifacts where original logic was deprecated, or simple logical oversights. Eliminating these functions reduces code clutter, simplifies application logic, and removes a marginal but unnecessary layer of computational overhead.

Problem detection License: MIT (opens in new tab)

#634. No point to have in a procedure COMMIT without ROLLBACK or vice versa

INFORMATION_SCHEMA+system catalog base tables

If you end transaction in a procedure, then there should be a possibility to either commit or rollback the transaction based on some condition. Procedures appeared in PostgreSQL 11.

Problem detection License: MIT (opens in new tab)

#635. Not enforced constraints

system catalog base tables only

This query identifies constraints (CHECK and FOREIGN KEY) that exist in the system catalog but are not actively enforced against the table data.

Problem detection License: MIT (opens in new tab)

#636. Not equals check in unstandardized way

INFORMATION_SCHEMA+system catalog base tables

Find user-defined routines that use != operator to test as to whether two values are not equal.

Problem detection License: MIT (opens in new tab)

#637. 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)

#638. Not inherited CHECK constraints that cover at least one column

system catalog base tables only

Find CHECK constraints that cover at least one column and that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable.

Problem detection License: MIT (opens in new tab)

#639. NOT IN or <> ALL in derived tables

INFORMATION_SCHEMA+system catalog base tables

Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor, especially in case of large data sizes.

Problem detection License: MIT (opens in new tab)

#640. NOT IN or <> ALL in routines

INFORMATION_SCHEMA+system catalog base tables

Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(sorted ascending, activate to sort descending) Data source(activate to sort ascending) Last update(activate to sort ascending) License Actions
621 Names of database objects with perhaps too many subcomponents (terms) "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) The number of subcomponents (terms) should not be too big. Find the names (identifiers) of user-defined database objects that perhaps contain too many subcomponents, assuming, that the separator of the components is "_". Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
622 Names of database objects with perhaps too many subcomponents (terms) that consist of only consonants Find names of database objects where the number of subcomponents (terms) that consist of only consonants is bigger than the number of subcomponents that contain at least one vowel. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
623 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
624 Names of triggers and rules that do not contain the table name The names should contain table name in order to make the names better understandable. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
625 Name starts or ends with spaces Find the names of user-defined database objects (must be delimited identifiers) that start or end with spaces. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
626 No need to use to_date or to_timestamp function Find expressions where a date literal with the ISO format is converted to date/timestamp by using to_date or to_timestamp function. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
627 Non-foreign key columns that have no associated CHECK constraints Find what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
628 Non-foreign key indexes that have been named as foreign key indexes Find indexes that are not on a foreign key column but the name of the index contains ixfk or idxfk. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
629 Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not Find non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
630 Non-native data types for network addresses This query identifies base table columns intended to store IP or network addresses that are not using PostgreSQL's native inet data type. It locates these columns by searching for specific English and Estonian naming patterns (such as 'ip', 'network', 'addr', or 'aadr'). Storing network addresses as generic text is an anti-pattern, as the inet type provides built-in validation, specialized network functions, and efficient indexing. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
631 Non-predefined character classes must not be between double square brackets Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
632 Non-updatable views that have data modification privileges Be precise and do not give impossible privileges. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
633 No-operation routines with static return values This query identifies SQL routines that are functionally equivalent to a no-operation (no-op) instruction, meaning their sole operation is to return either a constant literal or an unmodified input parameter. Such routines provide no transformation or logic. They are typically superfluous and may represent placeholder code from early development, refactoring artifacts where original logic was deprecated, or simple logical oversights. Eliminating these functions reduces code clutter, simplifies application logic, and removes a marginal but unnecessary layer of computational overhead. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
634 No point to have in a procedure COMMIT without ROLLBACK or vice versa If you end transaction in a procedure, then there should be a possibility to either commit or rollback the transaction based on some condition. Procedures appeared in PostgreSQL 11. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
635 Not enforced constraints This query identifies constraints (CHECK and FOREIGN KEY) that exist in the system catalog but are not actively enforced against the table data. Problem detection system catalog base tables only MIT (opens in new tab) View
636 Not equals check in unstandardized way Find user-defined routines that use != operator to test as to whether two values are not equal. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
637 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
638 Not inherited CHECK constraints that cover at least one column Find CHECK constraints that cover at least one column and that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. Problem detection system catalog base tables only MIT (opens in new tab) View
639 NOT IN or <> ALL in derived tables Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor, especially in case of large data sizes. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View
640 NOT IN or <> ALL in routines Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View