Compatablity Issue Between Versions of DuckDB

When i try to connect to my DuckDB database, I’m told that the version is wrong.

IO Error: Trying to read a database file with version number 64, but we can only read version 51.

The database file was created with an newer version of DuckDB.

The storage of DuckDB is not yet stable; newer versions of DuckDB cannot read old database files and vice versa.

The storage will be stabilized when version 1.0 releases.

For now, we recommend that you load the database file in a supported version of DuckDB, and use the EXPORT DATABASE command followed by IMPORT DATABASE on the current version of DuckDB.

See the storage page for more information: https://duckdb.org/internals/storage

DuckDB.DuckDBHandle(::String, ::DuckDB.Config)@database.jl:17
DuckDB.DB(::String, ::DuckDB.Config)@database.jl:82
DuckDB@database.jl:90[inlined]
connect(::Type{DuckDB.DB}, ::String)@database.jl:105
Main@Local: 1[inlined]

How do I check the version and change the version so that they match?

Will this be an issue with subsiquent versions of DuckDB, before 1.0 is released?

As the note says, they do not consider the storage format to be stable across versions at this time. Thus, you need to recreate the database using the latest version if you want to work with it in the latest version of DuckDB. Based on the message, it seems they do play to provide improved compatibility after version 1.0, but I think that will only apply to databases created with version 1.0+.

1 Like

How do I that in Julia? Should I use SQLite, and migrate everything to DuckDB later?

Whatever code you ran to create the database before, just run that again in the newer version of DuckDB and it will create the updated database.

How do I change the version of DuckDB in DuckDB.jl?

Try to export the database and then import it in the new version.

Install a previous version of the DuckDB.jl package.

I created a database in the new version using DBeaver, but I can’t connect using Pluto in Julia v1.10.0 or Julia v 1.9.3 .

Previous? But I’d think I’d want the latest version of DuckDB, since that’s what DBeaver uses.

I do not know exactly what your problem might be.

The error message is clear, however. The storage format dictates that databases can only be opened with the same version of DuckDB that was used to create it. So whatever version you connect to DBeaver is the same version you need to load in Julia.

I know that the version needs to be changed, everyone keeps saying that. Yet, no one explains how to change the version.

Here I see I have DuckDB v0.9.0, but I think I need v0.9.1

   Resolving package versions...
    Updating `~/.julia/environments/v1.10/Project.toml`
  [d2f5444f] + DuckDB v0.9.0
    Updating `~/.julia/environments/v1.10/Manifest.toml`
  [d2f5444f] + DuckDB v0.9.0
  [fb4d412d] + FixedPointDecimals v0.4.3
  [2cbbab25] + DuckDB_jll v0.9.1+0
Precompiling project...

how do I ensure I install the latest version?

You have the latest version. The DuckDB maintainers sort of messed up their versioning in my opinion.

There are two things here: one is the DuckDB.jl package, which is the Julia interface to the duckdb program, and the DuckDB_jll itself. DuckDB itself is at 0.9.1, which is reflected in the _jll that you have installed. DuckDB.jl latest release was numbered 0.9.0 rather than 0.9.1.