begriffs / pg_rational

Precise fractional arithmetic for PostgreSQL
MIT License
233 stars 14 forks source link

ERROR: extension "pg_rational" has no installation script nor update path for version "0.0.2" #16

Closed df7cb closed 4 years ago

df7cb commented 4 years ago

The 0.0.2 release is missing a pg_rational--0.0.1--0.0.2.sql file to enable upgrades from 0.0.1. Initial installation fails for the same reason.

ERROR:  extension "pg_rational" has no installation script nor update path for version "0.0.2"
begriffs commented 4 years ago

Hm, there were no SQL changes between these versions. Only the C code changed. So I guess I'll create an empty file for the upgrade script. I'll also move the v0.0.2 tag to another commit after fixing the problem, which is kind of a bad practice, but probably safe in this case.

Thanks for reporting.

df7cb commented 4 years ago

If the SQL part didn't change, there is no reason to change the SQL version. I'd recommend decoupling the project version number from the SQL version number just like SONAMEs in libraries.

df7cb commented 4 years ago

This is still broken because the Makefile doesn't install that file.

begriffs commented 4 years ago

This is still broken because the Makefile doesn't install that file.

Hmm, can you help me out with a pull request that does the proper code-vs-sql versioning, and installs the new version correctly?

The versioning thing is especially confusing to me, how the extension will have two versions, and how to match that with tags in my repo.

df7cb commented 4 years ago

I'd just leave the version at 0.0.1 in pg_rational.control.

begriffs commented 4 years ago

I'd just leave the version at 0.0.1 in pg_rational.control.

I could do that, although the recent PR #12 adding overflow checks was a very important fix. Anyone who installed the extension before the PR should upgrade.

If the version isn't bumped I worry that it won't signal to people that their installation could be updated. They'll see that they are on v0.0.1, and that this is also the latest version on Github.

How do extensions typically advertise bug fixes that don't affect the SQL interface?

df7cb commented 4 years ago

I don't think people really look at pg_available_extensions to check for updates, so the "advertisement" argument doesn't fit. Also, for that to work they need to update the extension on disk, and at that point they will already have the new .so in place with the fix.

For the versions, I'd go with something like 0.1 as the extension version, and ship 0.1.x package versions. Then bump the 0.1 only for SQL level changes. (Or 1 and 1.x.)

df7cb commented 4 years ago

Fwiw, I got the Debian package working now by reverting pg_rational.control back to 0.0.1.

The proper fix would be to tell the Makefile to actually install pg_rational--0.0.1--0.0.2.sql I think.

begriffs commented 4 years ago

@df7cb could you help me with a pull request to fix the Makefile to install the sql file?

(By the way, I've submitted a patch to add rational numbers as a base type to PostgreSQL itself, so hopefully we won't need an extension in the future.)