0

our goal is to get pg sql inbuilt functions present in a query given by an user.

TablesNamesFinder tablesNamesFinder = new TablesNamesFinder(){
@Override
public void visit(Function function) {
    functionNames.add(function.getName().toLowerCase());
    super.visit(function);
}
@Override
public void visit(TableFunction valuesList) {
    functionNames.add(valuesList.getFunction().getName().toLowerCase());
    super.visit(valuesList);
}
};

We have tried the above code but this will not give functions like

select current_user;
select current_schema;

SO kindly help us to get all functions in given sql query

Mohamed
  • 3
  • 2
  • 1
    So what does this `TablesNamesFinder` class do? And why do you expect a class that "finds tables" to return _function_ names? –  Dec 14 '22 at 07:36
  • SELECT * FROM pg_proc; should give you all the functions. See the manual for details: https://www.postgresql.org/docs/current/catalog-pg-proc.html – Frank Heikens Dec 14 '22 at 08:29

0 Answers0