koordinates / kart

Distributed version-control for geospatial and tabular data
https://kartproject.org
Other
515 stars 39 forks source link

Unexpected behaviour in kart add-dataset @ postgis #965

Closed FelixEickeler closed 5 months ago

FelixEickeler commented 5 months ago

Describe the bug When executing add-dataset on a table in a postgres working copy a ProgrammingError is thrown.

To Reproduce Steps to reproduce the behaviour:

  1. kart init --workingcopy postgresql://user:password@host:5432/database/schema --import ... (an actually empty gpkg)
  2. Create a new table in the schema (f.e. with QGIS)
  3. kart status --list-untracked-tables (interestingly this shows also the tracked table)
  4. kart add-dataset shown name with schema (testet alternatives without => not found | postgres URI => not found)
  5. See error

Expected behaviour This works as expected when using geopackages. New tables can be added via add-dataset command.

Output Traceback (most recent call last): File "kart_cli.py", line 4, in File "kart\cli.py", line 404, in entrypoint File "click\core.py", line 1157, in call File "click\core.py", line 1078, in main File "kart\cli_util.py", line 72, in invoke File "click\core.py", line 1688, in invoke File "click\core.py", line 1434, in invoke File "click\core.py", line 783, in invoke File "click\decorators.py", line 34, in new_func File "kart\add_dataset.py", line 71, in add_dataset File "kart\tabular\working_copy\base.py", line 639, in meta_items File "kart\sqlalchemy\adapter\base.py", line 148, in all_v2_meta_items File "kart\utils.py", line 25, in wrapper File "kart\sqlalchemy\adapter\postgis.py", line 137, in all_v2_meta_items_including_empty File "sqlalchemy\orm\session.py", line 1744, in scalar File "sqlalchemy\orm\session.py", line 1714, in execute File "sqlalchemy\engine\base.py", line 1705, in _execute_20 File "sqlalchemy\sql\elements.py", line 334, in _execute_on_connection File "sqlalchemy\engine\base.py", line 1572, in _execute_clauseelement File "sqlalchemy\engine\base.py", line 1943, in _execute_context File "sqlalchemy\engine\base.py", line 2124, in _handle_dbapiexception File "sqlalchemy\util\compat.py", line 211, in raise File "sqlalchemy\engine\base.py", line 1900, in _execute_context File "sqlalchemy\engine\default.py", line 736, in do_execute sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "we.we.is_this_tracked" does not exist LINE 1: SELECT obj_description(('we."we.is_this_tracked"')::regclass...

Version Info