Skip to content

Commit ce66c5c

Browse files
MasterOdinjgpruitt
authored andcommitted
fix: render view comments
Signed-off-by: Matthew Peveler <[email protected]>
1 parent 1220d56 commit ce66c5c

File tree

1 file changed

+2
-3
lines changed
  • projects/pgai/pgai/semantic_catalog/templates/templates

1 file changed

+2
-3
lines changed

projects/pgai/pgai/semantic_catalog/templates/templates/view.j2

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Expected context variables:
1515
- objid: PostgreSQL object ID
1616
- schema_name: Schema name
1717
- view_name: View name
18-
- table_name: Table name (for comments)
1918
- is_materialized: Boolean indicating if it's a materialized view
2019
- is_continuous_aggregate: Boolean indicating if it's a TimescaleDB continuous aggregate
2120
- definition: The SQL definition of the view
@@ -35,11 +34,11 @@ CREATE{% if view.is_materialized %} MATERIALIZED {% else %} {% endif %}VIEW {{ v
3534
{% endfor -%}
3635
*/
3736
{% if view.description is not none %}
38-
COMMENT ON TABLE {{ view.schema_name }}.{{ view.table_name }} IS $${{ view.description.description }}$$;
37+
COMMENT ON VIEW {{ view.schema_name }}.{{ view.view_name }} IS $${{ view.description.description }}$$;
3938
{% endif -%}
4039
{% for column in (view.columns if view.columns is not none else []) -%}
4140
{% if column.description is not none -%}
42-
COMMENT ON COLUMN {{ view.schema_name }}.{{ view.table_name }}.{{ column.name }} IS $${{ column.description.description }}$$;
41+
COMMENT ON COLUMN {{ view.schema_name }}.{{ view.view_name }}.{{ column.name }} IS $${{ column.description.description }}$$;
4342
{% endif -%}
4443
{% endfor -%}
4544
{% if view.sample is not none %}

0 commit comments

Comments
 (0)