Take the 2-minute tour ×

I have a problem with my iPad app. I have to convert a PostgreSQL database to SQLite database. Luckily I did it but I didn't know how to convert the PostgreSQL functions. Anyone knows how to did it? Or how can I get the same result in Sqlite?

Thanks in advance, Luca

share|improve this question
If you show us the function in question, we can better help you. –  colinmarc May 7 '11 at 18:13
It 's very long and is written in italian. However, it is a sql query that performs various join. In a join is connected to a function (create function PostgreSQL) and NOT to table. In Sqlite there are no function, I think. How do I? –  Luca May 7 '11 at 18:41
add comment

1 Answer

up vote 0 down vote accepted

As you allready discovered sqlite has no functions. So you will probably have to move some logic from the function and the single query out of your db into your app. This will probably mean executing a query looking at the result and based on that executing some more queries. So you can do the logic of the function in your app.

While this is not recommended in PostgreSQL as performance suffers from many small queries the performance loss in SQlite is much smaller as it is an embedded database (no communication overhead) and it's planner is more straight forward which makes the planning overhead of seperate queries smaller.

share|improve this answer
add comment

Your Answer


