Coder Social home page Coder Social logo

Comments (4)

mschoema avatar mschoema commented on June 19, 2024

Hi Wendell,

It seems that this is indeed a bug with the atGeometry function in the latest Beta.
I also tested this query on our develop branch, and the bug seems to be resolved.

Currently, if you need to use the atGeometry function, I would suggest using the latest version of the Develop branch.
We are preparing a new release that contains these modifications, but the next release date is not yet decided.

If you need help installing MobilityDB from the latest development branch, please let me know, I will be happy to help.

Maxime

from mobilitydb.

wendellwt avatar wendellwt commented on June 19, 2024

Maxime,

This doesn't happen often in my dataset, and it is not critical to fix, but yes, I would like to try out the Develop branch. I think that would be fun. I just want to make sure I can install the new one without causing PosgGreSQL to delete current tgeogpoint columns. (I found out the hard way that DROP EXTENSION MobilityDB does that, which turned out to be a bad thing to do.) I suppose the updgrade would be something like:

cmake ..
make
<stop postgresql>
sudo make install
<start postgresql>
psql -c 'ALTER EXTENSION MobilityDB UPDATE'
  • Q1) is it ok to do the make install and replace the existing libMobilityDB.so with the new one? I don't have to re-compile PostGreSQL or PostGIS do I?
  • Q2) when I run the "ALTER EXTENSION" command, the old .so file has already been replaced with the new one. Is that the right way to do it?
  • Q3) The PostGreSQL doc says "The extension must supply a suitable update script". Is that in place? Will the 'ALTER EXTENSION' know where that script is and how to run it?

I just want to be careful when I do this update.

Thanks,
Wendell

from mobilitydb.

mschoema avatar mschoema commented on June 19, 2024

This would be the right way to do it, but unfortunately, we do not have a suitable update script.
Currently, the only way to change versions is by dropping and re-creating the extension.

cmake ..
make
<stop postgresql>
sudo make install
<start postgresql>
psql -c 'DROP EXTENSION MobilityDB CASCADE'
psql -c 'CREATE EXTENSION MobilityDB CASCADE'

This will indeed require you to re-create the tgeogpoint and tgeompoint columns in the database.
And to answer Q1, no you do not need to re-compile PostgreSQL and PostGIS, running the sudo make install is sufficient.

One solution to not lose the tgeompoint columns completely is to store them as bytes in a temporary column, and to then re-create the initial columns in the new version of the extension.

<before dropping the extension>
ALTER TABLE table_name ADD COLUMN temp_name bytea;
UPDATE table_name SET temp_name = asEWKB(column_name);

<after dropping and re-creating the extension>
ALTER TABLE table_name ADD COLUMN column_name tgeompoint;
UPDATE table_name SET column_name = fromEWKB(temp_name);
ALTER TABLE table_name DROP COLUMN temp_name;

The function 'fromEWKB' only exists for tgeompoint currently, so you will need to cast your tgeogpoints into tgeompoints and back to use this technique for tgeogpoint columns.

Maxime

from mobilitydb.

estebanzimanyi avatar estebanzimanyi commented on June 19, 2024

We introduced input/output functions for all formats (Text, EWKT, MF-JSON, Binary, EWKB, HexWKB). They will be included in the next beta. Many thanks for helping us to develop this new functionality.

from mobilitydb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.