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.

#241. All non-unique indexes

INFORMATION_SCHEMA+system catalog base tables

Find secondary indexes that have been created in the database.

General License: MIT (opens in new tab)

#242. All parameters with DEFAULT values

INFORMATION_SCHEMA+system catalog base tables

Find parameters of user-defined routines that have a default value.

General License: MIT (opens in new tab)

#243. All partial indexes

INFORMATION_SCHEMA+system catalog base tables

Find indexes to a subset of table rows.

General License: MIT (opens in new tab)

#244. All rules

system catalog base tables only

Find user-defined rules for rewriting data manipulation language statements. Rules should be used only for the tasks that cannot be achieved in a declarative manner, i.e., for example, by declaring a constraint.

General License: MIT (opens in new tab)

#245. All security policies

system catalog base tables only

Find all security policies.

General License: MIT (opens in new tab)

#246. All sequence generators

INFORMATION_SCHEMA+system catalog base tables

Find all sequence generators.

General License: MIT (opens in new tab)

#247. All short cycles (tables)

INFORMATION_SCHEMA+system catalog base tables

Find pairs of tables that have both a foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables.

General License: MIT (opens in new tab)

#248. All supertables

system catalog base tables only

Find all the base tables that serve as supertables in the inheritance hierarchies

Sofware measure License: MIT (opens in new tab)

#249. All system-defined TOAST-able types

system catalog base tables only

Find system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).

General License: MIT (opens in new tab)

#250. All table CHECK constraints that cover at leat one column

INFORMATION_SCHEMA only

Find all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).

General License: MIT (opens in new tab)

#251. All table functions

INFORMATION_SCHEMA+system catalog base tables

Find all functions that return a set of rows.

General License: MIT (opens in new tab)

#252. All the non-primary key columns are optional

INFORMATION_SCHEMA only

Find base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements.

Problem detection License: MIT (opens in new tab)

#253. All unique keys have at least one optional column

INFORMATION_SCHEMA+system catalog base tables

Find base tables where all unique keys (sets of columns covered by a unique constraint, or a unique index) have at least one optional column. In this case there can be rows in the table where the values that should identify the row are missing. Because NULL is not a value and is not duplicate of another NULL the, follwing is possible: CREATE TABLE Uniq(a INTEGER NOT NULL,
b INTEGER,
CONSTRAINT ak_uniq UNIQUE (a, b));

INSERT INTO Uniq(a, b) VALUES (1, NULL);
INSERT INTO Uniq(a, b) VALUES (1, NULL);

Problem detection License: MIT (opens in new tab)

#254. All user-defined TOAST-able types

system catalog base tables only

Find user-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).

General License: MIT (opens in new tab)

#255. All user mappings

system catalog base tables only

Find all user mappings for foreign servers and tables

General License: MIT (opens in new tab)

#256. All user schemas

INFORMATION_SCHEMA only

Find all the schemas in the database that are not used for the system purposes.

General License: MIT (opens in new tab)

#257. All user triggers that are associated with tables

INFORMATION_SCHEMA+system catalog base tables

Find user-defined triggers that react to data modifications in tables. Triggers should be used only for the tasks that cannot be achieved in a declarative manner, i.e., by declaring a constraint. Triggers of the same table with the same event_manipulation, action_timing, and action_orientation are sorted based on the trigger name. This is the order of execution of triggers.

General License: MIT (opens in new tab)

#258. AND takes precedence over OR

INFORMATION_SCHEMA+system catalog base tables

Make sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator.

General License: MIT (opens in new tab)

#259. A non-parameterized table function instead of a view

INFORMATION_SCHEMA+system catalog base tables

Find table functions that do not have any parameters. Prefer simpler and more portable solutions.

Problem detection License: MIT (opens in new tab)

#260. A predefine character class has been incorrectly specified

INFORMATION_SCHEMA+system catalog base tables

Find regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:].

Problem detection License: MIT (opens in new tab)
# Name Goal Type Data source Last update (sorted descending) License Actions
241 All non-unique indexes Find secondary indexes that have been created in the database. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
242 All parameters with DEFAULT values Find parameters of user-defined routines that have a default value. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
243 All partial indexes Find indexes to a subset of table rows. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
244 All rules Find user-defined rules for rewriting data manipulation language statements. Rules should be used only for the tasks that cannot be achieved in a declarative manner, i.e., for example, by declaring a constraint. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
245 All security policies Find all security policies. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
246 All sequence generators Find all sequence generators. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
247 All short cycles (tables) Find pairs of tables that have both a foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
248 All supertables Find all the base tables that serve as supertables in the inheritance hierarchies Sofware measure system catalog base tables only MIT (opens in new tab) View (opens in new tab)
249 All system-defined TOAST-able types Find system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table). General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
250 All table CHECK constraints that cover at leat one column Find all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications). General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
251 All table functions Find all functions that return a set of rows. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
252 All the non-primary key columns are optional Find base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
253 All unique keys have at least one optional column Find base tables where all unique keys (sets of columns covered by a unique constraint, or a unique index) have at least one optional column. In this case there can be rows in the table where the values that should identify the row are missing. Because NULL is not a value and is not duplicate of another NULL the, follwing is possible: CREATE TABLE Uniq(a INTEGER NOT NULL,
b INTEGER,
CONSTRAINT ak_uniq UNIQUE (a, b));

INSERT INTO Uniq(a, b) VALUES (1, NULL);
INSERT INTO Uniq(a, b) VALUES (1, NULL);
Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
254 All user-defined TOAST-able types Find user-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table). General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
255 All user mappings Find all user mappings for foreign servers and tables General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
256 All user schemas Find all the schemas in the database that are not used for the system purposes. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
257 All user triggers that are associated with tables Find user-defined triggers that react to data modifications in tables. Triggers should be used only for the tasks that cannot be achieved in a declarative manner, i.e., by declaring a constraint. Triggers of the same table with the same event_manipulation, action_timing, and action_orientation are sorted based on the trigger name. This is the order of execution of triggers. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
258 AND takes precedence over OR Make sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
259 A non-parameterized table function instead of a view Find table functions that do not have any parameters. Prefer simpler and more portable solutions. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
260 A predefine character class has been incorrectly specified Find regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:]. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)