qwc-services / qwc-data-service

QWC Data service
MIT License
5 stars 10 forks source link

Problem with character varying in primary key #17

Closed quim96 closed 10 months ago

quim96 commented 1 year ago

I have several databases that the main identifier is a character varying and it gives me an error when updating as it tries to cast to integer. Do you have any solution? Thank you very much.

"(psycopg2.errors.UndefinedFunction) operator does not exist: character varying = integer LINE 4: WHERE node_id = 2743 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

[SQL: SELECT \"node_id\", \"node_id\", \"closed_valve\", \"broken_valve\", ST_AsGeoJSON(ST_CurveToLine(\"the_geom\")) AS json_geom, Box2D(\"the_geom\") AS bbox FROM \"ws\".\"v_edit_node\" WHERE node_id = %(id)s LIMIT 1; ] [parameters: {'id': 2743}] (Background on this error at: https://sqlalche.me/e/14/f405)"

netrebin commented 1 year ago

Some issues with varchar or uuid. But work perfect when identifier is integer type

manisandro commented 10 months ago

Non-int PKs are now supported as of https://github.com/qwc-services/qwc-data-service/commit/bf709b24d268f8e5ae92f2fbbedd57bb45c4a55f