Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Ah!  Good to know. Thank you!

On Tue, Jun 7, 2011 at 3:10 PM, Richard Hipp  wrote:

> On Tue, Jun 7, 2011 at 5:41 PM, Joe Goldthwaite 
> wrote:
>
> > I didn't realize that the Schema was just a
> > place for the developer to leave a note. I assumed that it was the
> sqlite's
> > internal database schema that was being used to describe some internal
> > control tables or something like that.
> >
> >
> PRAGMA user_version is just a number that the application can set to
> whatever it wants.  But PRAGMA schema_version is used internally by SQLite.
> If you set it manually, you can potentially corrupt the database file.  So
> don't change it unless you really know what you are doing.
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Richard Hipp
On Tue, Jun 7, 2011 at 5:41 PM, Joe Goldthwaite  wrote:

> I didn't realize that the Schema was just a
> place for the developer to leave a note. I assumed that it was the sqlite's
> internal database schema that was being used to describe some internal
> control tables or something like that.
>
>
PRAGMA user_version is just a number that the application can set to
whatever it wants.  But PRAGMA schema_version is used internally by SQLite.
If you set it manually, you can potentially corrupt the database file.  So
don't change it unless you really know what you are doing.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Thanks Richard.  It's good to know exactly what the problem is.  I'll stop
posting about it here and follow up with the pysqlite forum.

And thanks again to you Robert.  I didn't realize that the Schema was just a
place for the developer to leave a note. I assumed that it was the sqlite's
internal database schema that was being used to describe some internal
control tables or something like that.

On Tue, Jun 7, 2011 at 2:22 PM, Richard Hipp  wrote:

> On Tue, Jun 7, 2011 at 4:38 PM, Joe Goldthwaite 
> wrote:
>
> > I'm trying to read the Firefox cookies file (cookies.sqlite). It
> > worked fine in Firefox 3.5 and 3.6 but this is the first time I've tried
> it
> > since I upgraded to Firefox 4.  Now I'm getting an error message
> > "DatabaseError: file is encrypted or is not a database".  I can open the
> > file with sqlite3.exe and list the cookies.  I can also open it with the
> > SQLite Manager firefox add-on.
> >
>
> Recent versions of Firefox use "PRAGMA journal_mode=WAL" which requires
> SQLite version 3.7.0 or later.  You won't be able to read the database
> files
> with SQLite version 3.6.23.1 or earlier.  You'll get the "file is encrypted
> or is not a database" message.
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Richard Hipp
On Tue, Jun 7, 2011 at 4:38 PM, Joe Goldthwaite  wrote:

> I'm trying to read the Firefox cookies file (cookies.sqlite). It
> worked fine in Firefox 3.5 and 3.6 but this is the first time I've tried it
> since I upgraded to Firefox 4.  Now I'm getting an error message
> "DatabaseError: file is encrypted or is not a database".  I can open the
> file with sqlite3.exe and list the cookies.  I can also open it with the
> SQLite Manager firefox add-on.
>

Recent versions of Firefox use "PRAGMA journal_mode=WAL" which requires
SQLite version 3.7.0 or later.  You won't be able to read the database files
with SQLite version 3.6.23.1 or earlier.  You'll get the "file is encrypted
or is not a database" message.


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/07/2011 01:52 PM, Joe Goldthwaite wrote:
> It says the file is schema version 1, user version 2.  

That has *nothing* to do with the issue.  They are just two fields within a
SQLite 3 database.  You can change them to any arbitrary numbers you want
using pragmas:

  http://www.sqlite.org/pragma.html#pragma_schema_version

A common usage by programs is to keep track of when they update the schemas.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3ulY4ACgkQmOOfHg372QQHiACfb04Muecwh6tGdjNSFzN6zbqF
rNoAoNzroXLsGlIAgWP30ejk0PMw1JwE
=YW82
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Hi Roger,

I posted over there because it started looking like it's more of a pysql
problem than a sqlite 2 problem.  I copied the cookies.sqlite file from
Firefox 3.6 and opened it with the sqlite manager. It says the file is
schema version 1, user version 2.  That's a big difference from Firefox 4's
version.  Now I'm thinking that it still might be a version difference. It's
just not a sqlite 2 to 3 difference, it's possibly a schema 1 to 5  or user
2 to 4 difference.


On Tue, Jun 7, 2011 at 1:42 PM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I see you have now taken this up on the python-sqlite mailing list where
> we'll deal with the issue.  You've seriously mixed up Python, SQLite and
> pyqlite issues and Firefox's databases are SQLite 3 so SQLite 2 is
> completely irrelevant.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAk3ujTUACgkQmOOfHg372QQgLACfRlNEXhkd8VzgA/Iv4nspuCo+
> yUgAoMERTzSiI3KjBYo25dp3CZ9qAprK
> =/m2b
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I see you have now taken this up on the python-sqlite mailing list where
we'll deal with the issue.  You've seriously mixed up Python, SQLite and
pyqlite issues and Firefox's databases are SQLite 3 so SQLite 2 is
completely irrelevant.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3ujTUACgkQmOOfHg372QQgLACfRlNEXhkd8VzgA/Iv4nspuCo+
yUgAoMERTzSiI3KjBYo25dp3CZ9qAprK
=/m2b
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
You're right. It looks like the last release of sqlite 3 released in
September '04. It seems like the version of pysqlite that I'm using, which
was released Nov '09' would support it.  Maybe the version of sqlite isn't
my problem. I'm trying to read the Firefox cookies file (cookies.sqlite). It
worked fine in Firefox 3.5 and 3.6 but this is the first time I've tried it
since I upgraded to Firefox 4.  Now I'm getting an error message
"DatabaseError: file is encrypted or is not a database".  I can open the
file with sqlite3.exe and list the cookies.  I can also open it with the
SQLite Manager firefox add-on.

According to SQLite Manager, the file is Schema Version 5, User Version 4
and it's encoded with UTF-8.  I posted a question on the pysqlite list to
see if someone there can give me a clue.

Thanks for the response Roger.

On Tue, Jun 7, 2011 at 11:52 AM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 06/07/2011 11:41 AM, Joe Goldthwaite wrote:
> > The development environment I'm using is locked into
> > Python 2.4 and pysql for python 2.4 can only handle the older sqlite
> format.
>
> I'd suggest getting working with SQLite 3.  SQLite 2 is positively ancient
> and you'll have trouble finding modern tools that work with it correctly.
>
> The only pysql I can find works only with Oracle.
>
> My own Python wrapper for SQLite (APSW) supports SQLite 3 and Python 2.3
> onwards.  pysqlite is also SQLite 3 only and there are Windows binaries for
> Python 2.{5,6,7} but I suspect it will compile just fine against Python
> 2.4.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAk3uc4IACgkQmOOfHg372QQW3QCfXP88Hjpj0qEhoqViAaFZ7eoO
> COwAn3p2/dmML9dcuwDbjD4I6X6imLjt
> =KQtt
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/07/2011 11:41 AM, Joe Goldthwaite wrote:
> The development environment I'm using is locked into
> Python 2.4 and pysql for python 2.4 can only handle the older sqlite format.

I'd suggest getting working with SQLite 3.  SQLite 2 is positively ancient
and you'll have trouble finding modern tools that work with it correctly.

The only pysql I can find works only with Oracle.

My own Python wrapper for SQLite (APSW) supports SQLite 3 and Python 2.3
onwards.  pysqlite is also SQLite 3 only and there are Windows binaries for
Python 2.{5,6,7} but I suspect it will compile just fine against Python 2.4.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3uc4IACgkQmOOfHg372QQW3QCfXP88Hjpj0qEhoqViAaFZ7eoO
COwAn3p2/dmML9dcuwDbjD4I6X6imLjt
=KQtt
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
I've got a problem. I need to convert an sqlite3 database back to sqlite2's
format on a Windows machine.  I've found instructions on how to do it but
they require sqlite.exe which I can't seem to find anywhere! Does anyone
have a link where they can download the older version?

P.S. I know the sqlite3.exe is backward compatable with the old one but that
doesn't work for me. The development environment I'm using is locked into
Python 2.4 and pysql for python 2.4 can only handle the older sqlite format.
The database I'm reading however has been upgraded to sqlite3.  That leaves
me with no way to read it other than creating an entirely different
development environment using a newer version of Python. It would be much
easier to convert the sqlite3 back to sqlite2 if I could just find a copy of
sqlite.exe for Windows.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users