We have several naming schema for columns (like
create_date) and want to unify it.
Also we want to do it in backward compatible way. We want to be able to run old code together with new one until we get rid of old code, so following:
ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;
is a breaking change.
Is there some form of aliasing for columns like views for tables (for Postgresql)?
ANSWER @CL (tnx for tip!) https://www.postgresql.org/docs/12/ddl-generated-columns.html
A generated column cannot be written to directly. In INSERT or UPDATE commands, a value cannot be specified for a generated column, but the keyword DEFAULT may be specified.
So if an idea is to keep columns until you update all report script - it is fine. But if you want a rollback to previous app version - you are out of luck ((
Currently we are on Google Postgres Cloud offer: https://cloud.google.com/sql/docs/postgres/db-versions and v12 is in beta only.