PostgreSQL Grist FDW


I’ve hacked together a PostgreSQL Foreign Data Wrapper for Grist. Here is the link: GitHub - johncant/gristfdw: PostgreSQL Foreign Data Wrapper for Grist

The idea is that all the tables in your Grist document show up in PostgreSQL and you can query them.

So far, it only supports Grist types Text, Numeric, Int, and Bool, also, the SQL DELETE statement doesn’t work as expected. However, SELECT, INSERT and UPDATE are working! This means JOIN and UNION will also work.

Tested with PostgreSQL 15.2, Multicorn 1.4.0, and Grist 1.1.0


That’s pretty neat @John1, thanks for posting it! Is the problem with the DELETE in the Grist API code do you think?


The DELETE issue isn’t a problem with py_grist_api - I think it’s this: SEGFAULT with delete on PG14 · Issue #15 · pgsql-io/multicorn2 · GitHub . Postgres/multicorn are always passing 0 as the row id for deletion, which thankfully does not exist. If so, it might work with postgres 13 :slight_smile:

Can confirm - DELETE is working correctly with Multicorn 2.4 in Postgres 13 but broken in Postgres 14+, also, I now have some integration tests

1 Like

Date and Reference column types are now supported

Also, we now have a docker image, built from the main branch.

1 Like

Good progress! Appreciate the docker image.