public inbox for [email protected]  
help / color / mirror / Atom feed
show fct_name of the function/procedure
2+ messages / 2 participants
[nested] [flat]

* show fct_name of the function/procedure
@ 2024-04-27 19:53  ft <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: ft @ 2024-04-27 19:53 UTC (permalink / raw)
  To: [email protected]

Hello, 

I need (a very simple construct) to show the fct_name/proc_name 
for the function/procedure.

Example:
create procedure/function bet_process() as 
$$
declare
 pid      int  := pg_backend_pid() ; --  it works fine
 fct_name text := pg_fct_name()    ; --  I need it
begin
 -- do s.th like 
 -- call log(pid, fct_name, 'my message');
end;
$$ language plpgsql;

Franz







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: show fct_name of the function/procedure
@ 2024-04-27 20:01  David G. Johnston <[email protected]>
  parent: ft <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2024-04-27 20:01 UTC (permalink / raw)
  To: [email protected] <[email protected]>; +Cc: [email protected] <[email protected]>

On Saturday, April 27, 2024, ft <[email protected]> wrote:

>
>  fct_name text := pg_fct_name()    ; --  I need it
>
>

https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

PG_ROUTINE_OID

I think casting that to “regproc” will get you what you need.  Otherwise
there should be functions or a query to perform the needed lookup.

https://www.postgresql.org/docs/current/datatype-oid.html

David J.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-04-27 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-27 19:53 show fct_name of the function/procedure ft <[email protected]>
2024-04-27 20:01 ` David G. Johnston <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox