Support for PostgreSQL?


I have seen a few posts mentioning PostgreSQL but I am not quite sure yet if ERPNext has full support for PostgreSQL backend or if it’s still experimental. I have seen 5 years old posts about future Postgres implementation or recent bug/error reports.

I am considering implementing ERPNext in our organization but we also deal heavily with all sorts of geospatial data. In that matter, PostgreSQL/PostGIS is MUCH more powerful than MySQL, hence the need for it.

1 Like

Hi welcome to ERPNext!

FWIW with each code commit, the checkin tests run with PostgreSQL on the backend for example Travis CI - Test and Deploy Your Code with Confidence

EDIT: Note the tests exercise the frappe app code with Postgresql (and not erpnext)

Sorry but since English is not my primary language, I am not 100% sure what you mean. My understanding is that Postgres is fully supported. Am I right?

Good question! I can’t comment from experience. Postgres users here may want to comment.

As for geospatial data, ERPNext supports this Geolocation Field

Whatever due diligence tests you perform the community would welcome your feedback.

As well this forum is active for support too…

A search like this will help inform you Search results for 'Postgres after:2018-12-01' - ERPNext Forum

1 Like

Frappe Framework support PostgreSQL, ERPNext is still under process. You can try running ERPNext on PostgreSQL but some querries might not run as intended.

1 Like

What kind of queries and is anyone using it in production?

SQL queries used to make ERPNext work the way it does.

Frappe Framework is ready for Postgres but ERPNext is not. There are 1300 queries that might need refactoring as of July 2019.

If there is anyone willing to sponsor and use this in production, this is a project we can definitely invest time and effort.


My organization is actually in the process of installing ERPNext to use internally, as well as exploring the possibility to create an integration with our product (and offer it to customers that might not have an ERP currently).

For our next major release we are moving to PostgreSQL as our main DB, and as such would love to have ERPNext support this.

How can I help to implement better PostgreSQL support in ERPNext?

see Support for PostgreSQL? - #8 by rmehta

Hi @felix, I think perhaps I wasn’t too clear in my post.

I was interested in @rmehta’s comment, specifically “If there is anyone willing to sponsor and use this in production, this is a project we can definitely invest time and effort.”

We are certainly willing to use this in production, and I’m willing to make any changes and create PRs for increasing PostgreSQL integration.

What would “sponsorship” entail? Also, is there anywhere that is tracking what is still remaining for the integration, as per the comment “here are 1300 queries that might need refactoring as of July 2019”? (I didn’t see anything in the issues or in Milestones - frappe/erpnext · GitHub)

Thanks in advance.

1 Like

@kaysersoze am following and willing to help too

This is a solid 2 month project, will cost roughly $15k - $20k (excluding support). Drop us a mail at if you are interested.

The project will be a contribution to the product and community, and released in a new major release.

1 Like

Can’t sponsor the 20k ourselves but happy to contribute towards a crowdfunded pool. Especially because we could also then get a graphql layer automatically - thanks to Hasura.


would actually be a great feature if we could have a way to cooperatively sponsor things like this. I could offer 10% :slight_smile:

Any branch that focus on implementing postgreSQL? I think beginning by marking where the query is constructed inside the source code would help in starting postgreSQL database support effort.

Welcome to ERPNext Benedict!

I can find no Postgres branch nor Postgres-specific test cases.

But in any case here’s the latest Postgres test run

and the travis ansible build config for that

Here are example PRs for Postgres

This PR uses the database target frappe.db.multisql query construct

Here’s some (pandas library!) database target test code


@carto_aca just saw your post from 2019, were you able to build your solution that suit geospatial data?

Wherever you are Clark. Thank you.
Mis mejores deseos.


I want to modify my current site from using mariadb to use postgres OR create new site with db type postgres , I do :

bench new-site sitename --db-type postgres
but it return error :
ERROR: permission denied for schema public LINE 1: CREATE TABLE “tabDocField” ().

the database and user automatically created . how can I grant privileges to user before creation tables , any help please