'does mysql.connector work with postgreeSQL?

I am developing an app which uses MariaDB and mysql.connector for python. However, I reached to some point where I see that PostgreSQL could have benefits (e.g. it exists RETURNING). If I create again the database using Postgre, will I have to modify code related with mysql.connector in python? Or is the library totally compatible? If it's not, which library do I have to use?



Solution 1:[1]

You need a new library. You need to install psycopg2 or psycopg-binary depending on your operating system.

This link is a detailed tutorial https://www.postgresqltutorial.com/postgresql-python/connect/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Curious