Re: [v9.3] Extra Daemons (Re: elegant and effective way for running jobs inside a database)

Heikki Linnakangas <hlinnakangas@vmware.com>

From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kohei KaiGai <kaigai@kaigai.gr.jp>, Simon Riggs <simon@2ndquadrant.com>, Andrew Dunstan <andrew@dunslane.net>, Robert Haas <robertmhaas@gmail.com>, "David E. Wheeler" <david@justatheory.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-15T15:23:12Z
Lists: pgsql-hackers
On 15.11.2012 17:10, Alvaro Herrera wrote:
> Heikki Linnakangas escribió:
>> On 23.10.2012 00:29, Alvaro Herrera wrote:
>>> Here's an updated version of this patch, which also works in
>>> an EXEC_BACKEND environment.  (I haven't tested this at all on Windows,
>>> but I don't see anything that would create a portability problem there.)
>>
>> Looks good at first glance.
>
> Thanks.
>
>> Fails on Windows, though:
>>
>> "C:\postgresql\pgsql.sln" (default target) (1) ->
>> "C:\postgresql\auth_counter.vcxproj" (default target) (29) ->
>> (Link target) ->
>>    auth_counter.obj : error LNK2001: unresolved external symbol
>> UnBlockSig [C:\p
>> ostgresql\auth_counter.vcxproj]
>>    .\Release\auth_counter\auth_counter.dll : fatal error LNK1120: 1
>> unresolved externals [C:\postgresql\auth_counter.vcxproj]
>
> Wow.  If that's the only problem it has on Windows, I am extremely
> pleased.
>
> Were you able to test the provided test modules?

I tested the auth_counter module, seemed to work. It counted all 
connections as "successful", though, even when I tried to log in with an 
invalid username/database. Didn't try with an invalid password. And I 
didn't try worker_spi.

> I am unsure about the amount of pre-cooked stuff we need to provide.
> For instance, do we want some easy way to let the user code run
> transactions?

Would be nice, of course. I guess it depends on how much work would it 
be provide that. But we can leave that for later, once the base patch is in.

- Heikki