Function and Procedure with same signature?

From: Deepak M <mahtodeepak05(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Function and Procedure with same signature?
Date: 2024-02-09 20:05:18
Message-ID: CAMywLyJnJmJCiv8+B4bX4m84Tf1aDgxyh4CAu7cGem=qTtgZzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Hackers,

Folks, When tried to create a function with the same signature as procedure
it fails.

postgres=# create or replace procedure obj1(char) language plpgsql as $$
begin select $1; end; $$;
CREATE PROCEDURE
postgres=# create or replace function obj1(char) returns void language sql
as $$ select $1 $$;
ERROR: cannot change routine kind
DETAIL: "obj1" is a procedure.

any reason for failures?
Can procedure or function can be defined with the same signature i.e. name
and IN arguments ?
as callable for both is different.?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Luzanov 2024-02-09 20:08:11 Re: Add semi-join pushdown to postgres_fdw
Previous Message Nathan Bossart 2024-02-09 20:04:29 Re: glibc qsort() vulnerability