I Need a Query of getting the Current Computer name or Terminal Name using PostgreSQL Database Please Give me the solution ASAP
Asked
Active
Viewed 2,651 times
-4
-
-1 for "ASAP" - you are asking for free help here – Feb 22 '14 at 11:50
-
What "computer name"? The hostname of the database server? Or the hostname of the client? – exhuma Feb 22 '14 at 12:02
-
Hi,Here Computer name means Machine Name. Here,What I Need is, How TO Get the Query OF Current Machine Name Using PostgreSQL??? – urfrndchandu Mar 03 '14 at 06:26
1 Answers
2
Below may work for your needs. If you are on the console be careful with the results, likely you don't want to kill a postgres owned process.
SELECT inet_client_addr();
SELECT * FROM pg_stat_activity
WHERE client_addr = inet_client_addr();
*http://bytes.com/topic/postgresql/answers/423851-retrieve-ip-client-postgres *http://postgresql.1045698.n5.nabble.com/How-to-stop-a-query-td1924086.html
-
Hi, Thanks For your given Solution. But Here I am not getting the computer's name or terminal Name. – urfrndchandu Feb 25 '14 at 05:31