can't init dbsync when table has an index on id column?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Reproduce the issue using the SQL schema in the report, with and without the btree index, then trace dbsync's database-initialization path that generates the CREATE TABLE statement. Done means initialization succeeds when the id column has the additional btree index and no duplicate id column appears in the generated SQL.
Written by the indexing model from the issue text.
Description
I can't seem to start dbsync , initialised from the database when my table has a btree index on the id column.
CREATE TABLE my_polygon_table (
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
comment text,
date date,
recorded_by text,
validated boolean,
validated_by text,
geom geometry(Polygon,4326)
);
CREATE INDEX IF NOT EXISTS my_polygon_table_geom_gist
ON my_polygon_table USING gist (geom);
CREATE INDEX IF NOT EXISTS my_polygon_table_id_btree
ON my_polygon_table USING btree (id);
I get this error in dbsync :
Error: postgres cmd error: ERROR: column "id" specified more than once
|
|
| SQL:
| CREATE TABLE "z_for_mergin_use_only_db_sync"."my_polygon_table" ("id" integer NOT NULL, "id" integer NOT NULL, "comment" text, "date" date, "recorded_by" text, "validated" boolean, "validated_by" text, "geom" geometry(Polygon,4326), PRIMARY KEY ("id"));
However if I do the same without creating an index it works fine.
- Dominant language
- Python
- Stars
- 53
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/db-sync
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/db-sync#184 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
MerginMaps/db-sync#185 · 1 comment ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometries Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
MerginMaps/db-sync#182 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
MerginMaps/db-sync#181 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MerginMaps/db-sync#179 · 3 comments ·
All issues in MerginMaps/db-sync
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·