- Notifications
You must be signed in to change notification settings - Fork328
Closed
Description
It appears pgml.train does not properly escape the relation_name.
Relations can start with numbers and contain all kinds of crazy characters. Postgres allows these relations by using the syntax "schema"."relation_name" to escape such as:
postgres=# select count(*) from "public"."08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml"; count-------10000(1 row)
However, pgml.trian fails to find the relation when escaping the relation_name as follows:
postgres=# SELECT * FROM pgml.train('my_project', 'classification', '"public"."08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml"', 'failure', 'xgboost');INFO: Snapshotting table""public"."08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml"", this may take a little while...ERROR: Relation""public"".""08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml"" doesn't exist (snapshot.rs:747)
Or if you prefer without quotes:
postgres=# SELECT * FROM pgml.train('my_project', 'classification', 'public.08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml', 'failure', 'xgboost');INFO: Snapshotting table"public.08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml", this may take a little while...ERROR: syntax error ator near".08e56"LINE1: ..."tool_wear_time","torque","failure"FROMpublic.08e56f36-... ^QUERY:SELECT"process_temp","tool_wear_time","torque","failure"FROMpublic.08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml