Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't init dbsync when table has an index on id column? #148

Open
geographit2 opened this issue Jan 29, 2025 · 1 comment
Open

can't init dbsync when table has an index on id column? #148

geographit2 opened this issue Jan 29, 2025 · 1 comment

Comments

@geographit2
Copy link

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.

@ValentinBuira
Copy link

Hi @geographit2 thanks for the bug report that's indeed looks bad to not be able to use btree, I'll give it a try on my end with the SQL you provided, thanks you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants