# Custom postgresql types

**URL:** <https://discuss.ocaml.org/t/custom-postgresql-types/7545>\
**Category:** Learning\
**Tags:** pgocaml\
**Created:** [March 27, 2021, 11:57am UTC](https://discuss.ocaml.org/t/custom-postgresql-types/7545 "2021-03-27T11:57:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Pierre](https://discuss.ocaml.org/u/Pierre)\
**Post date:** [March 27, 2021, 11:57am UTC](https://discuss.ocaml.org/t/custom-postgresql-types/7545/1 "2021-03-27T11:57:42Z")

</div>

Hello,

I have a question regarding postgresql and custom types defined in postgresql. I have a table, full\_documents, with a column status, whose type is a custom enum type, named document\_status\_type.

When i try to run the following query

` let query dbh= [%pgsql dbh "select status from full_documents limit 1000"]`

I have the following error:

` Error: Unbound value document_status_type_of_string`

I then define the function document\_status\_type\_of\_string as follow:

`let document_status_type_of_string s= s`

It then works, but I have the following warning:  
`Warning 33: unused open PGOCaml.`

Is there something I could do to avoid having that warning ?

---

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [March 28, 2021, 4:33pm UTC](https://discuss.ocaml.org/t/custom-postgresql-types/7545/2 "2021-03-28T16:33:30Z")

</div>

You could remove the line `open PGOCaml` from the code.
