I create a view in postgres sql with sql statement
CREATE OR REPLACE VIEW {ViewName} as
Select
.....
I am asking is there any way to create comments for columns in the view. After the view is created, it generates an error when a comment is added to a column :
ERROR: "{ViewName}" is not a table, composite type, or foreign table.
To define a comment on a column (or a view) use comment on:
create view some_view
as
select x as col1, y as col2, z as col3
from some_table;
Then:
comment on view some_view is 'Some View';
comment on column some_view.col1 is 'Originally column X';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With