Filter Queries

Found 1056 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 the relatively small amount of data in the system catalog of a database.

#81. Find all non-foreign key columns of base tables

INFORMATION_SCHEMA+system catalog base tables

Find all non-foreign key columns of base tables. Make sure that no foreign key constraint is missing.

General License: MIT (opens in new tab)

#82. All identifying relationships

system catalog base tables only

Find all non-identifying relationships where the foreign key (a set of columns) is a subset of a uniqueness constraint (primary key, unique, or exclude constraint).

General License: MIT (opens in new tab)

#83. All non-identifying relationships

system catalog base tables only

Find all non-identifying relationships where the foreign key (a set of columns) is not a subset of any uniqueness constraint (primary key, unique, or exclude constraint).

General License: MIT (opens in new tab)

#84. Personal names are unique

system catalog base tables only

Find all primary key and unique constraints of base tables that involve at least one column with personal names. Personal names are not unique and these cannot be (usually) used to guarantee uniqueness. Either one has declared a superkey instead of candidate key (i.e., the key contains a column that is not needed for uniqueness) or the key columns have been found incorrectly.

Problem detection License: MIT (opens in new tab)

#85. Extension routines

system catalog base tables only

Find all routines that belong to an extension.

General License: MIT (opens in new tab)

#86. All security policies

system catalog base tables only

Find all security policies.

General License: MIT (opens in new tab)

#87. All sequence generators

INFORMATION_SCHEMA+system catalog base tables

Find all sequence generators.

General License: MIT (opens in new tab)

#88. All clustered indexes

system catalog base tables only

Find all tables that rows have been physically sorted based on an index.

General License: MIT (opens in new tab)

#89. Default is NULL

INFORMATION_SCHEMA only

Find all tables where default value is NULL. NULL is the marker that denotes missing value. Implicitly all columns that do not have a default value have the default NULL. There is no need to specify such default value.

Problem detection License: MIT (opens in new tab)

#90. Should the time zone be recorded in case of time or not?

INFORMATION_SCHEMA only

Find all the base table columns that have the type time without time zone or time with time zone. Return the data only if there is at least one column with the type time without time zone and one column with the type time with time zone.

Problem detection License: MIT (opens in new tab)

#91. Should the time zone be recorded in case of timestamp or not?

INFORMATION_SCHEMA only

Find all the base table columns that have the type timestamp without time zone or timestamp with time zone. Return the data only if there is at least one column with the type timestamp without time zone and one column with the type timestamp with time zone.

Problem detection License: MIT (opens in new tab)

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

#93. Comments of schemas, sequences, types, domains, domain constraints, and event triggers

system catalog base tables only

Find all the comments that have been added with a COMMENT statement to schemas, sequences, types, domains, and event triggers.

General License: MIT (opens in new tab)

#94. All column DEFAULT values

INFORMATION_SCHEMA only

Find all the default values of base table, view, and foreign table columns.

General License: MIT (opens in new tab)

#95. Different ways how to find default timestamp values

INFORMATION_SCHEMA only

Find all the default values of base table, view, and foreign table columns that are expressions invoking a function that returns a timestamp. Do it only if there are different expressions, i.e., there could be possible inconsistencies.

Problem detection License: MIT (opens in new tab)

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

#97. UPDATE triggers

INFORMATION_SCHEMA only

Find all UPDATE triggers. Make sure that they specify a correct set of columns in which data modification will fire the trigger.

General License: MIT (opens in new tab)

#98. All user mappings

system catalog base tables only

Find all user mappings for foreign servers and tables

General License: MIT (opens in new tab)

#99. The total number of physical lines of code in the bodies of user-defined SQL and PL/pgSQL functions/procedures

INFORMATION_SCHEMA+system catalog base tables

Find a numerical measure that describes the extent of the database public interface (virtual data layer) through which users access the database.

Sofware measure License: MIT (opens in new tab)

#100. Middle-man

INFORMATION_SCHEMA+system catalog base tables

Find a routine that's only task is to invoke another routine. If a routine performs only one action, delegating work to another routine, why does it exist at all?

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(sorted ascending, activate to sort descending) Type(activate to sort ascending) Data source(activate to sort ascending) Last update(activate to sort ascending) License Actions
81 Find all non-foreign key columns of base tables Find all non-foreign key columns of base tables. Make sure that no foreign key constraint is missing. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
82 All identifying relationships Find all non-identifying relationships where the foreign key (a set of columns) is a subset of a uniqueness constraint (primary key, unique, or exclude constraint). General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
83 All non-identifying relationships Find all non-identifying relationships where the foreign key (a set of columns) is not a subset of any uniqueness constraint (primary key, unique, or exclude constraint). General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
84 Personal names are unique Find all primary key and unique constraints of base tables that involve at least one column with personal names. Personal names are not unique and these cannot be (usually) used to guarantee uniqueness. Either one has declared a superkey instead of candidate key (i.e., the key contains a column that is not needed for uniqueness) or the key columns have been found incorrectly. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
85 Extension routines Find all routines that belong to an extension. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
86 All security policies Find all security policies. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
87 All sequence generators Find all sequence generators. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
88 All clustered indexes Find all tables that rows have been physically sorted based on an index. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
89 Default is NULL Find all tables where default value is NULL. NULL is the marker that denotes missing value. Implicitly all columns that do not have a default value have the default NULL. There is no need to specify such default value. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
90 Should the time zone be recorded in case of time or not? Find all the base table columns that have the type time without time zone or time with time zone. Return the data only if there is at least one column with the type time without time zone and one column with the type time with time zone. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
91 Should the time zone be recorded in case of timestamp or not? Find all the base table columns that have the type timestamp without time zone or timestamp with time zone. Return the data only if there is at least one column with the type timestamp without time zone and one column with the type timestamp with time zone. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
92 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)
93 Comments of schemas, sequences, types, domains, domain constraints, and event triggers Find all the comments that have been added with a COMMENT statement to schemas, sequences, types, domains, and event triggers. General system catalog base tables only MIT (opens in new tab) View (opens in new tab)
94 All column DEFAULT values Find all the default values of base table, view, and foreign table columns. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
95 Different ways how to find default timestamp values Find all the default values of base table, view, and foreign table columns that are expressions invoking a function that returns a timestamp. Do it only if there are different expressions, i.e., there could be possible inconsistencies. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
96 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)
97 UPDATE triggers Find all UPDATE triggers. Make sure that they specify a correct set of columns in which data modification will fire the trigger. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
98 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)
99 The total number of physical lines of code in the bodies of user-defined SQL and PL/pgSQL functions/procedures Find a numerical measure that describes the extent of the database public interface (virtual data layer) through which users access the database. Sofware measure INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
100 Middle-man Find a routine that's only task is to invoke another routine. If a routine performs only one action, delegating work to another routine, why does it exist at all? Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)