Routine (function) changes return type to SETOF record

When I click on a function, it always changes the return type to “RETURNS SETOF record” which is a change that breaks my c# code. Is this normal/expected/supposed to discourage other return types or an oversight? I am new to postgres and datagrip.

Comment actions Permalink


You could check original DDL of a function by qerying the database like shown here :

select pg_get_functiondef(oid)
from pg_proc
where proname = 'your_routine_name';

and compare the results with what DataGrip is displaying. If they are different please report at providing the details and output from Test Connection button in the data source Settings.

Comment actions Permalink There was already a bug with this same issue created, but I didn't find it until now.

If I right click the function and copy DDL, the return type is a table, which is what I want. 

When I double click a function to edit it, the routine editor displays RETURNS SETOF record.

If I make any change to the routine, it will overwrite the routine return type, which breaks my C# code.

After any changes made in the routine editor, copying the routine's DDL shows "RETURNS SETOF record"


Please sign in to leave a comment.