Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013

    Unanswered: how to detect the function name which is being run

    Hi All,

    I have a case where I need to detect the function name from the function I'm running now.
    I was working on MS SQL database before, and I can use @@procid to get the procedure name I'm running, inside it's own procedure.

    example in MS SQL :
    create proc dbo.myproc

    select @@procid

    return 0

    If I execute this :
    exec dbo.myproc

    it will return :

    I'm wondering how can I do this in Postgree, without using hardcode inside the function.

    can anyone help ?
    thanks before..

  2. #2
    Join Date
    Nov 2003
    Provided Answers: 23
    Quote Originally Posted by kaoru View Post
    in Postgree
    There is no DBMS called Postgree.
    It's either Postgres or PostgreSQL (or simply PG if the context is clear).

    And no, I don't think there is such a function in Postgres
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags:

    Tips for good questions:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts