sqlite3 .dump

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlite3 .dump

phaworth
Couple of questions regarding the above command.

Why does the above command include a PRAGMA foreign_keys=OFF command?

Wouldn't it make more sense for the CREATE  commands to include IF NOT
EXISTS?


Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3 .dump

Richard Hipp-3
On 5/12/15, Peter Haworth <[hidden email]> wrote:
> Couple of questions regarding the above command.
>
> Why does the above command include a PRAGMA foreign_keys=OFF command?

So that the script generator does not have to carefully arrange the
order of the INSERT statements to avoid a foreign key constraint
error.

>
> Wouldn't it make more sense for the CREATE  commands to include IF NOT
> EXISTS?
>

No.  The script is suppose to recreate a database from scratch.  The
tables should not already exist.  If they do, then something is wrong,
and an error is appropriate.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users