I have an application that uses Advantage Database Server. I want to migrate this application to PostgreSQL. To set the name of the application that established a connection to the database, I use the sp_SetApplicationID(ApplicationID) procedure.
EXECUTE PROCEDURE sp_SetApplicationID(:appname);
To get the application name, I use the sp_GetApplicationID() procedure.
EXECUTE PROCEDURE sp_GetApplicationID();
Is there such a possibility in PostgreSQL?
For example, if I run the following sql query in PostgreSQL, I will see application_name of all connections to the database. There can be many connections.
SELECT * FROM pg_stat_activity;
But I don't know how to change application_name for the current connection using SQL query. And can I get the application_name back. Maybe there is another way?