0

I'm migrating from a SQL Server database to opensource Postgres database.

SQL Server has a system variable called @@PROCID. I wanted to get its equivalent in PostgreSQL.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • So what does `@@procid` do or represent? –  Jul 12 '21 at 06:02
  • [Microsoft doc for @@PROCID](https://learn.microsoft.com/en-us/sql/t-sql/functions/procid-transact-sql?view=sql-server-ver15). @@PROCID will return a scalar value of the object id (from the system catalog) for the current 'module' (as described by Microsoft) for stored procedures, user-defined functions, or triggers. – trenton-ftw Jul 12 '21 at 06:24
  • 2
    Does this answer your question? [Getting name of the current function inside of the function with plpgsql](https://stackoverflow.com/questions/12611596/getting-name-of-the-current-function-inside-of-the-function-with-plpgsql) – SMor Jul 12 '21 at 10:38
  • Try: select pg_backend_pid()::text; – Belayer Jul 12 '21 at 18:04

0 Answers0