Skip to content

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

@geographit2

Description

@geographit2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions