Thread: inet_client_addr() implementation

inet_client_addr() implementation

From
"J. ORIOL"
Date:
Hello,

I was in the archives, looking for some concrete info about inet_client_addr() use, but only a C function found.

I have some clients to my app. (PG 8.2 in XP LAN). I want to generate auto-logs with trigger function for every table and for every event, but I cannot include clint ip address yet.

When the triggers starts and execute  SELECT  inet_client_addr(), will retrieve client's ip ?? or just 127.0.0.1

Some tips are very useful to me.

Thanks in advance.

Oriol M.


----------------------
J. Oriol Mujica F.
----------------------
Bucaramanga - COLOMBIA

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Re: inet_client_addr() implementation

From
Magnus Hagander
Date:
On Thu, Apr 05, 2007 at 07:57:41AM -0500, J. ORIOL wrote:
> Hello,
>
> I was in the archives, looking for some concrete info about inet_client_addr() use, but only a C function found.
>
> I have some clients to my app. (PG 8.2 in XP LAN). I want to generate auto-logs with trigger function for every table
andfor every event, but I cannot include clint ip address yet. 
>
> When the triggers starts and execute  SELECT  inet_client_addr(), will retrieve client's ip ?? or just 127.0.0.1

It should return the clients IP.

(If you're using say a web-ap, that will be 127.0.0.1, since it can't know
where the browser is. But if the client does a direct connection to the
database, it should return it)

//Magnus


Re: inet_client_addr() implementation

From
"J. ORIOL"
Date:
Thanks Magnus,

I have working my triggers, just with 127.0.0.1, soon I'll make tests with LAN clients.

Best regards.

Magnus Hagander <magnus@hagander.net> escribió:
On Thu, Apr 05, 2007 at 07:57:41AM -0500, J. ORIOL wrote:
> Hello,
>
> I was in the archives, looking for some concrete info about inet_client_addr() use, but only a C function found.
>
> I have some clients to my app. (PG 8.2 in XP LAN). I want to generate auto-logs with trigger function for every table and for every event, but I cannot include clint ip address yet.
>
> When the triggers starts and execute SELECT inet_client_addr(), will retrieve client's ip ?? or just 127.0.0.1

It should return the clients IP.

(If you're using say a web-ap, that will be 127.0.0.1, since it can't know
where the browser is. But if the client does a direct connection to the
database, it should return it)

//Magnus




----------------------
J. Oriol Mujica F.
----------------------
Bucaramanga - COLOMBIA

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Help!! Crash recovery

From
Jaime Silvela
Date:
I know you've probably discussed this in many places, but I have a crash
right now I need to recover from, and I'm not finding documentation that
fast.
Where should I go?

Here are the details on starting, after a kill -9 of a process brought
Postgres down.

Is there a page/s with information on quick recovery after corruption?
LOG:  could not create IPv6 socket: Address family not supported by protocol
LOG:  database system was interrupted while in recovery at 2007-04-05
08:18:47 EDT
HINT:  This probably means that some data is corrupted and you will have
to use the last backup for recovery.



***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.

Bear Stearns does not provide tax, legal or accounting advice.  You
should consult your own tax, legal and accounting advisors before
engaging in any transaction. In order for Bear Stearns to comply with
Internal Revenue Service Circular 230 (if applicable), you are notified
that any discussion of U.S. federal tax issues contained or referred to
herein is not intended or written to be used, and cannot be used, for
the purpose of:  (A) avoiding penalties that may be imposed under the
Internal Revenue Code; nor (B) promoting, marketing or recommending to
another party any transaction or matter addressed herein.
***********************************************************************

Re: Help!! Crash recovery

From
Bill Moran
Date:
In response to Jaime Silvela <JSilvela@Bear.com>:

> I know you've probably discussed this in many places, but I have a crash
> right now I need to recover from, and I'm not finding documentation that
> fast.
> Where should I go?
>
> Here are the details on starting, after a kill -9 of a process brought
> Postgres down.
>
> Is there a page/s with information on quick recovery after corruption?
> LOG:  could not create IPv6 socket: Address family not supported by protocol
> LOG:  database system was interrupted while in recovery at 2007-04-05
> 08:18:47 EDT
> HINT:  This probably means that some data is corrupted and you will have
> to use the last backup for recovery.

Do you have dumps?  Hopefully you do, in which case your best bet may be
to backup your config files, then blow away the cluster directory and
re-initdb, then restore from dump.

--
Bill Moran
http://www.potentialtech.com