Welcome to SQLite3!

Make sure SQLite3 is appropriate for your use; for some use cases a
client-server database like PostgreSQL is recommended:

"Situations Where A Client/Server RDBMS May Work Better
...If there are many client programs sending SQL to the same database over
a network, then use a client/server database engine [such as PostgreSQL]
instead of SQLite. SQLite will work over a network filesystem, but because
of the latency associated with most network filesystems, performance will
not be great.   ...A good rule of thumb is to avoid using SQLite in
situations where the same database will be accessed directly (without an
intervening application server) and simultaneously from many computers over
a network."
https://www.sqlite.org/whentouse.html

Assuming SQLite is appropriate/use scenario to your application; I agree
with Simon to use the SQL dump to transfer.

One area where SQL itself is not standardized is the syntax for testing for
NOT NULL.

According two the PostgreSQL documentation there are two ways to test for
NULL; SQLite will only accept the second method "NOTNULL"; the "IS NOT
NULL" syntax does not work.

PostgreSQL documentation:
"To check whether a value is or is not null, use the constructs:

expression IS NULLexpression IS NOT NULL

or the equivalent, but nonstandard, constructs:

expression ISNULLexpression NOTNULL

Do not write expression = NULL because NULL is not "equal to" NULL."
http://www.postgresql.org/docs/9.1/static/functions-comparison.html


I had used Microsoft Access, so I was used to the "IS NOT NULL" syntax and
had to learn "NOTNULL".

It  is not the end of the world, but it could be a gotcha.

Other than that one exception, whenever I have gotten the SQL correct
SQLite3 has worked for me.

HTH,
Jim Callahan
Orlando, FL

On Sun, Jul 5, 2015 at 4:11 PM, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 5 Jul 2015, at 1:44pm, c.buhtz at posteo.jp wrote:
>
> > Is there a way (free, open source, Ubuntu) to convert a
> > PostgreSQL-database with data in it to a sqlite database?
>
> Dump the Postgres database to a text file of SQL commands.  Then use the
> SQLite command-line tool to .read that text file.
>
> <http://www.postgresql.org/docs/9.4/static/backup-dump.html>
> <https://www.sqlite.org/download.html>
> <https://www.sqlite.org/cli.html>
>
> There may be some minor differences in the two versions of SQL and you may
> have to deal with them before SQLite will .read your file.  If you're not
> sure of equivalents post here and we'll try to help.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to