The list of all the queries

Base table column of personal names has questionable properties

Query goal: Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name (mononymous persons). Database design must take it into account.
Notes about the query: The query considers both column names in English and Estonian.
Query type: Problem detection (Each row in the result could represent a flaw in the design)
Query reliability: Low (Many false-positive results)
Query license: MIT License
Fixing suggestion: Increase the field size of the column. In case of having columns given name and surname and either a) make both columns optional (permit NULLs) and declare a CHECK constraint that in case of each row at least one of these values must be registered or b) make column given name mandatory (NOT NULL) and surname optional (permits NULLs).
Data source: INFORMATION_SCHEMA only
SQL query: Click on query to copy it

SELECT c.table_schema, c.table_name, c.column_name,  c.data_type, c.character_maximum_length, 
CASE WHEN c.character_maximum_length>100 THEN 'Although some names are very long such names are rare and too long field size
may cause more problems than it solves' 
WHEN c.data_type='text' THEN 'Do not forget to put a cap to the length by using a CHECK constraint!'
ELSE 'OK' END AS comment_length,
c.is_nullable,
CASE WHEN c.is_nullable='NO' THEN 'Make sure to accommodate mononymous persons!' ELSE 'OK' END AS comment_nullable
FROM information_schema.columns AS c
WHERE (c.table_schema, c.table_name) IN (SELECT table_schema, table_name
FROM INFORMATION_SCHEMA.tables WHERE table_type='BASE TABLE') AND 
c.table_schema NOT IN (SELECT schema_name
FROM INFORMATION_SCHEMA.schemata
WHERE schema_name<>'public' AND
schema_owner='postgres' AND schema_name IS NOT NULL)
AND c.column_name~*'^[_]*(eesnimi|perenimi|perekonnanimi|firstname|first_name|given_name|givenname|surname|family_name|last_name|lastname)[_]*$'
AND (c.character_maximum_length>100 OR c.is_nullable='NO' OR c.data_type='text')
ORDER BY c.table_schema, c.table_name, c.ordinal_position;

Collections where the query belongs to

Collection nameCollection description
Find problems about base tablesA selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview
Find problems about integrity constraintsA selection of queries that return information about the state of integrity constraints in the datadabase. Contains all the types of queries - problem detection, software measure, and general overview
Find problems automaticallyQueries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .

Categories where the query belongs to

Category nameCategory description
Field sizeQueries of this category provide information about the maximum size of values that can be recorded in column fields
Missing dataQueries of this category provide information about missing data (NULLs) in a database.
Result quality depends on namesQueries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results.
Validity and completenessQueries of this category provide information about whether database design represents the world (domain) correctly (validity) and whether database design captures all the information about the world (domain) that is correct and relevant (completeness).

Reference materials for further reading

Reference
https://en.wikipedia.org/wiki/Hubert_Blaine_Wolfeschlegelsteinhausenbergerdorff_Sr.
https://en.wikipedia.org/wiki/Mononymous_person
https://digi.lib.ttu.ee/i/?7072
https://digikogu.taltech.ee/et/Item/ab7e8f7e-ce28-4cc1-bb78-40c624d19bf6
https://stackoverflow.com/questions/30485/what-is-a-reasonable-length-limit-on-person-name-fields
https://ux.stackexchange.com/questions/55529/what-should-the-character-limits-for-first-last-name-inputs-be

The list of all the queries