Обсуждение: I, nead to capture the IP number from the PC how is running the script ...

Поиск
Список
Период
Сортировка

I, nead to capture the IP number from the PC how is running the script ...

От
John Dizaro
Дата:
I, nead to capture the IP number from the PC how is running the script <br />"update TABLE1 set campo1 = 123 where ...;
"<br/>Can someone help me please?<br /><br clear="all" /><br />-- <br />John Evan Dizaro - <br />Fone: (41)
3333-0303<br/> Fone: (41) 9243-3240<br />Rua: Alferes Poli Curitiba - PR - Brasil<br /> 

Re: I, nead to capture the IP number from the PC how is running the script ...

От
"Ing. Marcos Ortiz Valmaseda"
Дата:
John Dizaro escribió:
> I, nead to capture the IP number from the PC how is running the script
> "update TABLE1 set campo1 = 123 where ...; "
> Can someone help me please?
>
>
> -- 
> John Evan Dizaro -
> Fone: (41) 3333-0303
> Fone: (41) 9243-3240
> Rua: Alferes Poli Curitiba - PR - Brasil
inet_client_addr(): inet address of the client
inet_client_port(): client''s port number for this connection

Regards

-- 
-------------------------------------------------------- 
-- Ing. Marcos Luís Ortíz Valmaseda                   --
-- Twitter: http://twitter.com/@marcosluis2186        --
-- FreeBSD Fan/User                                   --
-- http://www.freebsd.org/es                          --
-- Linux User # 418229                                --
-- Database Architect/Administrator                   --
-- PostgreSQL RDBMS                                   --
-- http://www.postgresql.org                          --
-- http://planetpostgresql.org                        --
-- http://www.postgresql-es.org                       --
--------------------------------------------------------
-- Data WareHouse -- Business Intelligence Apprentice --
-- http://www.tdwi.org                                --
-------------------------------------------------------- 
-- Ruby on Rails Fan/Developer                        --
-- http://rubyonrails.org                             --
--------------------------------------------------------

Comunidad Técnica Cubana de PostgreSQL
http://postgresql.uci.cu
http://personas.grm.uci.cu/+marcos    

Centro de Tecnologías de Gestión de Datos (DATEC) 
Contacto:                                                                    Correo: centalad@uci.cu
                          Telf: +53 07-837-3737                                                     +53 07-837-3714
                                  
 
Universidad de las Ciencias Informáticas        
http://www.uci.cu         





Re: I, nead to capture the IP number from the PC how is running the script ...

От
Gerardo Herzig
Дата:
John Dizaro wrote:
> I, nead to capture the IP number from the PC how is running the script
> "update TABLE1 set campo1 = 123 where ...; "
> Can someone help me please?
> 
> 
the pg_stat_activity view has a column named client_addr and a
current_query column.

That should help.

Gerardo


Re: I, nead to capture the IP number from the PC how is running the script ...

От
silly sad
Дата:
On 03/15/10 22:18, John Dizaro wrote:
> I, nead to capture the IP number from the PC how is running the script

first of all you must tell us how your client is connected to your database?
there are a lot of different variants, and the most common of them is 
not PG related at all while the connection is made via http.


Re: I, nead to capture the IP number from the PC how is running the script ...

От
Niklas Johansson
Дата:
On 15 mar 2010, at 20.18, John Dizaro wrote:
> I, nead to capture the IP number from the PC how is running the script


Check the documentation for System Information Functions:

http://www.postgresql.org/docs/8.4/interactive/functions-info.html

The function inet_client_addr() will return the address of the remote  
connection.





Sincerely,

Niklas Johansson