MerginMaps / MerginMaps/geodiff

Timezone info is lost when applying diff from sqlite to postgres

Open
#198 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
183
Forks
21
Avg merge
9d 11h
Merged PRs (30d)
2

Description

I have a table with DATETIME column type containing a value with timezone info. When doing a copy to postgres, the timezone info is lost - and mergin-db-sync reports that there is an issue in geodiff.

2022/11/04 02:50:27.305+02   -- original value in sqlite
2022-11-04 02:50:27.305      -- what gets stored in postgres (we're using "timestamp without time zone" type)
2022-11-04T02:50:27.305Z     -- when we do copy back from postgres to sqlite

A workaround for now is not to use date/time values with timezone info.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the SQLite-to-Postgres copy using a DATETIME value with timezone information, then trace the geodiff path reported by mergin-db-sync. Compare the original SQLite value, the stored PostgreSQL value, and the value copied back to SQLite. Done means timezone information is handled consistently without triggering the reported geodiff issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.