# How to use the comments/descriptions in schema file into the database

**URL:** <https://discourse.getdbt.com/t/how-to-use-the-comments-descriptions-in-schema-file-into-the-database/19295>\
**Category:** Help\
**Tags:** macros, dbt-core\
**Created:** [May 7, 2025, 7:49am UTC](https://discourse.getdbt.com/t/how-to-use-the-comments-descriptions-in-schema-file-into-the-database/19295 "2025-05-07T07:49:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpegenaute](https://avatars.discourse-cdn.com/v4/letter/x/c5a1d2/32.png) [@xpegenaute](https://discourse.getdbt.com/u/xpegenaute)\
**Post date:** [May 7, 2025, 7:49am UTC](https://discourse.getdbt.com/t/how-to-use-the-comments-descriptions-in-schema-file-into-the-database/19295/1 "2025-05-07T07:49:17Z")

</div>

## The problem I’m having

I have defined some table and columns descriptions as stated in the [documentation](https://docs.getdbt.com/reference/resource-properties/description). It properly generates the documentation with `dbt docs generate`. But I would like that when I run the model, when the database allows it, it also store the description with the use of `COMMENT ON COLUMN ...`.

## The context of why I’m trying to do this

I am working with dbt 1.7.3 and the database is a postgres.

## What I’ve already tried

Using a post-hook, I tried to implement some macro able to read from the `schema.yml` but apparently I can not/I don’t know howto load any file.

I tried also to know if I can reach the schema within the dbt object data, but I did not find how to do it.

Any one tried this before ?, how could I do it ?

Thanks!

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [May 7, 2025, 7:54am UTC](https://discourse.getdbt.com/t/how-to-use-the-comments-descriptions-in-schema-file-into-the-database/19295/2 "2025-05-07T07:54:20Z")

</div>

Setting persist\_docs columns to true should solve it: [https://docs.getdbt.com/reference/resource-configs/persist\_docs](https://docs.getdbt.com/reference/resource-configs/persist_docs)

Note: `@rhasenack` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1746604443688879?thread_ts=1746604187.080229&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![nicole.erbe](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/nicole.erbe/32/5196_2.png) [@nicole.erbe](https://discourse.getdbt.com/u/nicole.erbe)\
**Post date:** [June 11, 2025, 6:48pm UTC](https://discourse.getdbt.com/t/how-to-use-the-comments-descriptions-in-schema-file-into-the-database/19295/3 "2025-06-11T18:48:43Z")

</div>

Is it possible to enable persist\_docs not just model by model inside a project but in general for a whole project?
