refer function name by a variable in the function body

From: Suresh Raja <suresh(dot)rajaabc(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: refer function name by a variable in the function body
Date: 2016-02-16 15:41:18
Message-ID: CAJP7dtDr++ZXgPEXoayNQfjjHBwBc7607iuj84PS2Pk8HZqfyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Hi All:

I use the function name in the body of pgsql code of the same function. Is
the function name set to any variable that i can easily reference. Now I'm
hard coding the function name in the code.

create or replace function compute_X(a1 text) returns text as
.....
...
Begin
.....
....
select user into user_id;
raise info 'starting function compute_X as %' user_id || timeofday();

end;

In the above Raise info i use select user to get the login role, similarly
can i use a variable for function name which is automatically set by the
system.

Thanks,
-SR

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-02-16 15:54:44 Re: Suggest note in index documentation about long running transactions
Previous Message Melvin Davidson 2016-02-16 14:14:30 Re: Proper use of Groups and Users (Roles).

Browse pgsql-sql by date

  From Date Subject
Next Message hubert depesz lubaczewski 2016-02-16 16:15:39 Re: [SQL] refer function name by a variable in the function body
Previous Message Inoue, Hiroshi 2016-02-15 11:53:05 Re: PostgreSQL: Inserting NULL values adds empty string.