If you need two columns with the same content but with different names, then use instead a view on top of the table.
Data Source
INFORMATION_SCHEMA only
SQL Query
SELECT table_schema, table_name, column_name, generation_expression
FROM INFORMATION_SCHEMA.columns AS c
WHERE (table_schema, table_name) IN (SELECT table_schema, table_name
FROM INFORMATION_SCHEMA.tables WHERE table_type='BASE TABLE')
AND 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 is_generated='ALWAYS'
AND EXISTS (SELECT *
FROM INFORMATION_SCHEMA.columns AS c2
WHERE c.table_name=c2.table_name
AND c.generation_expression=c2.column_name)
ORDER BY table_schema, table_name, ordinal_position;
Collections
This query belongs to the following collections:
Name
Description
Find problems automatically
Queries, 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
This query is classified under the following categories:
Name
Description
Duplication of implementation elements
Queries of this catergory provide information about the duplication of the database objects.
Generated columns
Queries of this category provide information about generated stored base table columns.