SUSER_NAME Function - SQL Server to PostgreSQL Migration

In SQL Server, the SUSER_NAME function returns the current user.

In PostgreSQL, you can use the SESSION_USER function.

SQL Server:

  -- Get the current user
  SELECT SUSER_NAME();
  /* DMT14\paul */

PostgreSQL:

  -- Get the current user
  SELECT SESSION_USER;
  /* paul */

For more information, see SQL Server to PostgreSQL Migration.