pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Define a function with a `setof` return type

Open robertsosinski opened this issue 1 month ago • 2 comments
trafficstars

Describe the solution you'd like

A simple way to define a function that returns setof something for set returning functions. Perhaps a toggle called Returns a set? that when activated will define the specified Return type as setof.

Describe alternatives you've considered

Just clicking the Custom return type? toggle, and typing in setof <my type>. This works, but I don't get to use the dropdown list that has my type.

Additional context

Here is a proposed screen snip of how this could look, with a Returns a set? toggle under the Custom return type? toggle.

Image

Thanks!

robertsosinski avatar Oct 18 '25 17:10 robertsosinski

Hey y'all,

So, funny enough, turns out the exact thing I was looking for (with exactly the same wording) existed this whole time, just on the "Options" tab when making a function;

Image

Wondering if it makes sense to move it to the "Definition" tab, as that is where you are specifying the return type?

Either way, I got what I need now, just took me poking around more to see a feature that might have been there for a long time.

Thanks!

robertsosinski avatar Oct 19 '25 18:10 robertsosinski

Moving Returns a set? to to definition along with other return stuff makes more sense.

adityatoshniwal avatar Oct 22 '25 05:10 adityatoshniwal