[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Introduce debversion type for storing package versions

Following previous discussion about using a Debian version type in
PostgreSQL, to allow for correct checking and sorting of versions
inside the database itself (rather than on the client side), a
couple of patches follow which add the necessary code to do this,
and then to get projectb to use it.

This allows sorting, indexing and joining on versions.

This implementation has been tested quite a lot by myself to
verify that all the operators (< > <= >= <> =) work correctly,
and that they also work for sorting in queries as well as on
indexed columns.  All the code is commented.

The code makes use of code derived from the Perl Dpkg::Version code.
This duplication is necessary to use PL/Perl, which for security will
not allow untrusted code to run on the server.  By using PL/PerlU,
which allows use to import modules, Dpkg::Version could be used
directly.  However, I chose to make it secure initially; it can
easily be changed depending on your requirements.


Reply to: