.dump command and user_version

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

.dump command and user_version

wmertens
I noticed that `.dump` does not output the user_version pragma. It seems to
me that that is part of the database data?

I don't actually use it, but it might be interesting to add this for
completeness?

sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
sqlite> pragma user_version=50;
sqlite> pragma user_version;
50
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
_______________________________________________
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: .dump command and user_version

Simon Slavin-3


On 29 Mar 2018, at 1:47pm, Wout Mertens <[hidden email]> wrote:

> I noticed that `.dump` does not output the user_version pragma. It seems to
> me that that is part of the database data?
>
> I don't actually use it, but it might be interesting to add this for
> completeness?

.dump is for things which affect data and data integrity only.  "PRAGMA foreign_keys" is one of the few PRAGMAs which affects data integrity: if a database is operated with that PRAGMA not set, the data could be corrupted.

Numerous PRAGMAs have no effect on integrity.  For example the journal mode and page size.  They are not included in the output of .dump.

Simon.
_______________________________________________
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: .dump command and user_version

Scott Robison-2
On Thu, Mar 29, 2018 at 6:56 AM, Simon Slavin <[hidden email]> wrote:

>
>
> On 29 Mar 2018, at 1:47pm, Wout Mertens <[hidden email]> wrote:
>
>> I noticed that `.dump` does not output the user_version pragma. It seems to
>> me that that is part of the database data?
>>
>> I don't actually use it, but it might be interesting to add this for
>> completeness?
>
> .dump is for things which affect data and data integrity only.  "PRAGMA foreign_keys" is one of the few PRAGMAs which affects data integrity: if a database is operated with that PRAGMA not set, the data could be corrupted.
>
> Numerous PRAGMAs have no effect on integrity.  For example the journal mode and page size.  They are not included in the output of .dump.

Yet as he said, user_version is data. It can be queried and can be
checked to make decisions about what to do with the data. It seems a
reasonable to suggestion to add it.
_______________________________________________
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: .dump command and user_version

Richard Hipp-3
On 3/29/18, Scott Robison <[hidden email]> wrote:
>  It seems a
> reasonable to suggestion to add it.

Version 3.23.0 is in bug-fix-only mode.  It'll have to wait.

--
D. Richard Hipp
[hidden email]
_______________________________________________
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: .dump command and user_version

Simon Slavin-3
In reply to this post by Scott Robison-2


On 29 Mar 2018, at 3:10pm, Scott Robison <[hidden email]> wrote:

> Yet as he said, user_version is data. It can be queried and can be
> checked to make decisions about what to do with the data. It seems a
> reasonable to suggestion to add it.

On consideration, I see the point.  Would you want to dump

PRAGMA schema_version

too ?

Simon.
_______________________________________________
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: .dump command and user_version

Scott Robison-2
In reply to this post by Richard Hipp-3
On Thu, Mar 29, 2018, 8:18 AM Richard Hipp <[hidden email]> wrote:

> On 3/29/18, Scott Robison <[hidden email]> wrote:
> >  It seems a
> > reasonable to suggestion to add it.
>
> Version 3.23.0 is in bug-fix-only mode.  It'll have to wait.
>

Of course. I wasn't suggesting that it should be done with all haste, just
agreeing with the original suggestion.

>
_______________________________________________
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: .dump command and user_version

Ian Zimmerman-2
In reply to this post by wmertens
On 2018-03-29 12:47, Wout Mertens wrote:

> I noticed that `.dump` does not output the user_version pragma. It
> seems to me that that is part of the database data?

I have run into this too.  I was trying to transport Mozilla browser
"places" database this way, and it turned out their code cares about the
user_version datum and thinks the file is corrupt if the value doesn't
match their expectation.

--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users