Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 28C592E003F for ; Thu, 15 May 2008 15:08:15 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79191-01 for ; Thu, 15 May 2008 15:08:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 75F5A2E002D for ; Thu, 15 May 2008 15:08:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m4FI831h009304; Thu, 15 May 2008 14:08:03 -0400 (EDT) To: Andrew Dunstan cc: Merlin Moncure , Alvaro Herrera , "Patches (PostgreSQL)" , Andrew Chernow Subject: Re: libpq object hooks In-reply-to: <482C7778.40707@dunslane.net> References: <482A58D8.2030205@dunslane.net> <20080514043313.GS6966@alvh.no-ip.org> <482AD896.4000504@dunslane.net> <19342.1210776271@sss.pgh.pa.us> <6044.1210867771@sss.pgh.pa.us> <482C7778.40707@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Thu, 15 May 2008 13:48:40 -0400" Date: Thu, 15 May 2008 14:08:03 -0400 Message-ID: <9303.1210874883@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/282 X-Sequence-Number: 6308 Andrew Dunstan writes: > Tom Lane wrote: >> It might work to use the address of the hook callback function as >> a key for retrieving the associated void * pointer. You'd need to >> not register the same callback function more than once per object, >> but from what I gather here you don't need to. > Or else have the library return a unique handle when registering hooks, > rather than supplying a hook name. Uh, how would that solve your problem? Seems like the difficulty shifts from "how do I get the hook data" to "how do I get the key with which to get the hook data". regards, tom lane