Skip to content

pgml.train does not properly escape relation_name #1326

Closed
@kalensk

Description

@kalensk

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 at or near ".08e56"
LINE 1: ... "tool_wear_time", "torque", "failure" FROM public.08e56f36-...
                                                             ^
QUERY:  SELECT "process_temp", "tool_wear_time", "torque", "failure" FROM public.08e56f36-7c89-4eea-9b17-0ab9785e6b2b_pgml

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy