A
A
aaltw2021-08-10 13:25:58
PostgreSQL
aaltw, 2021-08-10 13:25:58

How to create a function with parameters in DBeaver (in postgres)?

611252b3aa1ac172069764.png
In DBeaver, an empty function is created by right-clicking on Functions -> Create New Function

After creation, it is added to this section with functions and looks like this:
611252fda5e93808883811.png

How to add parameters to it?

61125360dc48c946433494.png
There is nothing to add here.

Adding parameters in brackets:

CREATE OR REPLACE FUNCTION public."_test_func"(column_name character varying, column_table character varying)

and saving - also adds nothing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-08-10
@altw

You cannot add parameters to an existing function with the same name - PG has polymorphism of functions: functions with the same name but different parameters are different functions.
Delete this one, create a new one (via SQL: CREATE FUNCTION). I won't tell you exactly how to edit the parameters in dbeaver.

H
himmelcross, 2021-08-11
@himmelcross

in DBeaver I create functions in the menu: "SQL Editor" | "New SQL Editor"
i.e. in the built-in query editor.
As galaxy rightly noted, a function with the same name can have a different set of parameter types.
For example, I have these:
public.actorprotocolday(varchar, bpchar);
and
public.actorprotocolday(varchar, bpchar, int);
and if you have any l.b. one of them is wrong, delete it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question