We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Database changed from mysql to postgre

If I have started and completed my app using mysql and then suppose I have to use postgre in that application, does I have to make any changes in my code or all will works fine without any changes?

Also one another question is that I have a database having no relations means no foreign keys then can I write the queries having multiple joins?

If you're not using raw queries but PHQL, your application must work in one database system or another without problems.

You can write PHQL with JOINS: https://docs.phalcon.io/en/latest/reference/phql.html#joins

But there are the raw queries in PHQL in a link https://docs.phalcon.io/en/latest/reference/phql.html#joins then how these works when I changed mysql to postgres. I mean mysql functions or attributes syntax may differ from the postgres or other database engine.

If you're using PHQL (https://docs.phalcon.io/en/latest/reference/phql.html) which is a high level SQL that internally is translated to the proper SQL statements according to the database system you won't have any problems. If you're using raw SQL statements, here you could have problems as these aren't translated by Phalcon automatically.

When I say raw queries, I want to say, queries that aren't using PHQL, like these: https://docs.phalcon.io/en/latest/reference/phql.html#using-raw-sql