# \#postgresql

**URL:** https://discuss.ocaml.org/tag/postgresql/112.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Using package postgresql and waiting for a notify](https://discuss.ocaml.org/t/using-package-postgresql-and-waiting-for-a-notify/17780)

<div class="topic-metadata">

**Author:** [@jbe](https://discuss.ocaml.org/u/jbe)\
**Replies:** 3\
**Last updated:** [February 7, 2026, 9:40am UTC](https://discuss.ocaml.org/t/using-package-postgresql-and-waiting-for-a-notify/17780 "2026-02-07T09:40:06Z")

</div>

I’m using the postgresql package and would like to wait for a NOTIFY without repeatedly polling. The connection class provides the methods #consume\_input and #socket which could be used in a loop with Unix.select. This …

---

## [\[ANN\] fun-sql 0.2.3](https://discuss.ocaml.org/t/ann-fun-sql-0-2-3/14806)

<div class="topic-metadata">

**Author:** [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Replies:** 11\
**Last updated:** [October 9, 2025, 3:55pm UTC](https://discuss.ocaml.org/t/ann-fun-sql-0-2-3/14806 "2025-10-09T15:55:13Z")

</div>

I am happy to announce the initial release of fun-sql, a simple functional-style query library for SQLite and PostgreSQL. To use it with SQLite: https://ocaml.org/p/fun-sqlite To use it with PostgreSQL: fun-postgresql …

---

## [Dune Compilation Error on Setting Up postgresql](https://discuss.ocaml.org/t/dune-compilation-error-on-setting-up-postgresql/16166)

<div class="topic-metadata">

**Author:** [@aguluman](https://discuss.ocaml.org/u/aguluman)\
**Replies:** 0\
**Last updated:** [February 23, 2025, 6:52pm UTC](https://discuss.ocaml.org/t/dune-compilation-error-on-setting-up-postgresql/16166 "2025-02-23T18:52:22Z")

</div>

I am facing an error message trying to use postgres, caqti on my project, but i am getting this error message, when i try, dune build. dune build File "bin/dune", line 3, characters 7-11: 3 | (name main) ^^^…

---

## [Which library to query a database (postgreSQL) is popular in OCaml?](https://discuss.ocaml.org/t/which-library-to-query-a-database-postgresql-is-popular-in-ocaml/15129)

<div class="topic-metadata">

**Author:** [@espioka](https://discuss.ocaml.org/u/espioka)\
**Replies:** 3\
**Last updated:** [August 14, 2024, 12:52pm UTC](https://discuss.ocaml.org/t/which-library-to-query-a-database-postgresql-is-popular-in-ocaml/15129 "2024-08-14T12:52:28Z")

</div>

I am building an application that will need to persist data in a database. I need to query this database. I don’t mind either the ORM approach or the sql-query writing approach. I saw a couple of options around, but I w…

---

## [Ppx\_rapper WHERE IN empty list](https://discuss.ocaml.org/t/ppx-rapper-where-in-empty-list/13669)

<div class="topic-metadata">

**Author:** [@mudrz](https://discuss.ocaml.org/u/mudrz)\
**Replies:** 9\
**Last updated:** [December 26, 2023, 3:02pm UTC](https://discuss.ocaml.org/t/ppx-rapper-where-in-empty-list/13669 "2023-12-26T15:02:08Z")

</div>

I have the following table: CREATE TABLE my\_table ( id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, label text ); INSERT INTO public.my\_table(id, label) VALUES (1,'item 1'), (2,'item 2'), (3,'item 3');…

---

## [\[ANN\] Petrol 1.2.0 release - Postgres Support + User-extensible types](https://discuss.ocaml.org/t/ann-petrol-1-2-0-release-postgres-support-user-extensible-types/11691)

<div class="topic-metadata">

**Author:** [@Gopiandcode](https://discuss.ocaml.org/u/Gopiandcode)\
**Replies:** 4\
**Last updated:** [March 22, 2023, 3:13am UTC](https://discuss.ocaml.org/t/ann-petrol-1-2-0-release-postgres-support-user-extensible-types/11691 "2023-03-22T03:13:38Z")

</div>

Heyo all! I’m pleased to announce the latest release of Petrol - A high level typed SQL API for OCaml (in the process of being published to opam). This latest release is exciting as it now adds Postgresql support (prev…

---

## [Best Postgresql binding?](https://discuss.ocaml.org/t/best-postgresql-binding/11169)

<div class="topic-metadata">

**Author:** [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Replies:** 13\
**Last updated:** [January 13, 2023, 3:47am UTC](https://discuss.ocaml.org/t/best-postgresql-binding/11169 "2023-01-13T03:47:28Z")

</div>

I see that there are a bunch of different Postgresql interfaces for OCaml. Caqti, PGO’Caml, PostgreSQL-OCaml, PGX. Does anybody know of a comparison of all these, maybe to help guide somebody making a choice of which …

---

## [Adding Lwt code to the Dream main loop](https://discuss.ocaml.org/t/adding-lwt-code-to-the-dream-main-loop/9773)

<div class="topic-metadata">

**Author:** [@Haudegen](https://discuss.ocaml.org/u/Haudegen)\
**Replies:** 3\
**Last updated:** [May 3, 2022, 2:41pm UTC](https://discuss.ocaml.org/t/adding-lwt-code-to-the-dream-main-loop/9773 "2022-05-03T14:41:29Z")

</div>

I don’t know if this is the best forum to ask questions about the Dream web framework. Please point me to the correct place, if necessary. I’d like to add some code to the Dream main loop. This code should not run in …

---

## [How to use ppx syntax for PGOCaml in ocsigen?](https://discuss.ocaml.org/t/how-to-use-ppx-syntax-for-pgocaml-in-ocsigen/5126)

<div class="topic-metadata">

**Author:** [@ruyblast](https://discuss.ocaml.org/u/ruyblast)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 9:42pm UTC](https://discuss.ocaml.org/t/how-to-use-ppx-syntax-for-pgocaml-in-ocsigen/5126 "2020-02-07T21:42:10Z")

</div>

Hello! I am using ocsgigen-start and I try to run following code with ppx PGOCaml syntax: let%server () = Eliom\_registration.Action.register ~service:post\_info (fun () info -\> let%lwt () = let d…

---

## [What is a good and maintained SQL toolkit for ocaml?](https://discuss.ocaml.org/t/what-is-a-good-and-maintained-sql-toolkit-for-ocaml/1915)

<div class="topic-metadata">

**Author:** [@mrkaspa](https://discuss.ocaml.org/u/mrkaspa)\
**Replies:** 2\
**Last updated:** [April 27, 2018, 10:27am UTC](https://discuss.ocaml.org/t/what-is-a-good-and-maintained-sql-toolkit-for-ocaml/1915 "2018-04-27T10:27:30Z")

</div>

I’d like to know about a good toolkit for sql handling in ocaml

---

## [Caqti 0.9.0 release - Compatibility layer for database clients](https://discuss.ocaml.org/t/caqti-0-9-0-release-compatibility-layer-for-database-clients/1522)

<div class="topic-metadata">

**Author:** [@paurkedal](https://discuss.ocaml.org/u/paurkedal)\
**Replies:** 13\
**Last updated:** [March 3, 2018, 5:06pm UTC](https://discuss.ocaml.org/t/caqti-0-9-0-release-compatibility-layer-for-database-clients/1522 "2018-03-03T17:06:52Z")

</div>

A am please to finally announce the first release of Caqti to our main opam repository. Caqti is an RDBMS client library for OCaml, currently shipped with drivers for MariaDB, PostgreSQL, and Sqlite3. In additional to …

---

## [Are there any OCaml solutions for DBMS connection pooling and query/request queues?](https://discuss.ocaml.org/t/are-there-any-ocaml-solutions-for-dbms-connection-pooling-and-query-request-queues/1028)

<div class="topic-metadata">

**Author:** [@egoholic](https://discuss.ocaml.org/u/egoholic)\
**Replies:** 4\
**Last updated:** [November 2, 2017, 9:09am UTC](https://discuss.ocaml.org/t/are-there-any-ocaml-solutions-for-dbms-connection-pooling-and-query-request-queues/1028 "2017-11-02T09:09:56Z")

</div>

Are there any OCaml solutions for DBMS connection pooling and query/request queues? First of all I’m interested in solutions for PostgreSQL RDBMS. P.S. Dear admins, could you please add category for DB-related questions…
