Sometimes it would be nice to inform the user about who has locked which record in a table. To do so we need to determined who we are in terms of PostgreSQL connection ids.
- Depending on the scenario you need to determine
- image-name: use appname()
- process-id: The process id can be retrieved using the WIN32 GetCurrentProcessId() API
- computername: The workstation name can be retrieved via GetEnv("computername")
- In case multiple workstations are connected to the PostgreSQL server use SELECT * FROM "alaska-software.system.connections" WHERE workstation='<computername>'
- In case of RDP scenario, multiple processes per server use SELECT * FROM "alaska-software.system.connections" WHERE process='<image-name>#process-id'
- The column connection_id is the id which is used as a lock_owner in the ISAM emulation
Note all values (computername, process and usrename) are always lower case.