Thread: eventlog fix

eventlog fix

From
"Laurent Ballester"
Date:
Hello,



The purpose of this patch is to fix an error when log_destination is set to
'eventlog' value in postgresql.conf files.



If you launch postmaster and see after fir log in windows event report
tools, you will see an error message with postgresql message like that :







Sorry for this French copy screen, the error message is: description for id
event #0 is missing for PostgreSQL source.



To fix the error it is mandatory to describe and register a message with an
ID set to 0. The message is declared in a MC file whish need to be compiled
by MC compiler. The MC compiler is part of core SDK and is not available
with Msys tools but can be freely downloaded from Microsoft web site, so I
suggest storing in CVS msg00001.bin a bin file result of MC compiler.



The rest of DLL is functions to allow setup program to register/unregister
DLL to windows registry database after copy it in it's target directory.
(regsvr32 pgevent.dll to register, regsvr32 /u pgevent.dll to unregister
it).



After discussion on win32 mailing list, I suggest to store source under
src/bin/pg_event

regards,

Laurent Ballester

Attachment

Re: eventlog fix

From
"Magnus Hagander"
Date:
> The purpose of this patch is to fix an error when
> log_destination is set to 'eventlog' value in postgresql.conf files.

Looks good to me, just a couple of tiny things:

<snip>

> After discussion on win32 mailing list, I suggest to store
> source under src/bin/pg_event

I assume you mean src/bin/pgevent, to be consistent with the naming used
inside the program.


Second, I'd register the source as "PostgreSQL", not "PostGreSQL". I
don't think the "captital-G" is generally used, and it's specifically
NOT what the backend uses. Sure, the key reading process is
case-insensitive today, but it's still a good idea to keep things
consistent :-)

(Actually, this goes for the error msgs as well)


Finally, I'd also move the GetModuleFilename() call to before
RegCreateKey(). In the (very rare) case that it would fail, you don't
want to alerady have created the registry key.



//Magnus


Re: eventlog fix

From
"Laurent Ballester"
Date:
Hello magnus,

> I assume you mean src/bin/pgevent, to be consistent with the naming used
> inside the program.

OK, I Modify Makefile subdir value. In fact I name it pg_event because many
directory under src/bin began with pg_ .

> Second, I'd register the source as "PostgreSQL", not "PostGreSQL". I
> don't think the "captital-G" is generally used, and it's specifically
> NOT what the backend uses. Sure, the key reading process is
> case-insensitive today, but it's still a good idea to keep things
> consistent :-)

I modify pgevent.c, for your both remarks: "capital G" are disappears from
source and I move GetModuleFilename() before RegCreateKey() call.

I sent full set file again, it will be easier to apply.

regards,

Laurent

Attachment

Re: eventlog fix

From
Alvaro Herrera
Date:
On Thu, Jun 03, 2004 at 12:33:29AM +0200, Laurent Ballester wrote:

> I modify pgevent.c, for your both remarks: "capital G" are disappears from
> source and I move GetModuleFilename() before RegCreateKey() call.
>
> I sent full set file again, it will be easier to apply.

> /* Global variables */
> HANDLE g_hModule = NULL;                    /* hModule of DLL */

We don't use this hungarian notation anywhere ... it certainly looks
ugly.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Y eso te lo doy firmado con mis lágrimas" (Fiebre del Loco)


Re: eventlog fix

From
"Laurent Ballester"
Date:
Hello,

>
> We don't use this hungarian notation anywhere ... it certainly looks
> ugly.
>

Sorry, I modify pgevent.c again and suppress all hungarian variables naming.

I add a diff -c for src/bin/Makefile, necessary to compile pgevent for
windows platform.


regards

Laurent Ballester

Attachment

Re: eventlog fix

From
Bruce Momjian
Date:
Would you send me documentation explaining how to register this DLL with
the event logger on Win32?  Ideally you could send me a diff against
installation.sgml.

---------------------------------------------------------------------------

Laurent Ballester wrote:
> Hello,
>
> >
> > We don't use this hungarian notation anywhere ... it certainly looks
> > ugly.
> >
>
> Sorry, I modify pgevent.c again and suppress all hungarian variables naming.
>
> I add a diff -c for src/bin/Makefile, necessary to compile pgevent for
> windows platform.
>
>
> regards
>
> Laurent Ballester

[ Attachment, skipping... ]

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: eventlog fix

From
"Laurent Ballester"
Date:
>
> Would you send me documentation explaining how to register this DLL with
> the event logger on Win32?  Ideally you could send me a diff against
> installation.sgml.
>

Hello Bruce,



After the DLL was in it target directory (C:\msys\1.0\local\pgsql\lib with
make install)

You can register the DLL to windows event log with the command

Regsvr32 pgevent.dll or regsvr32 /s pgevent.dll whish is a silent mode.



To uninstall, regsvr32 /u pgevent.dll will delete key add by the DLL in
Windows registry.



The DLL create the following entry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\P
ostgreSQL] with two values :

EventMessageFile wish contains full path of DLL
C:\msys\1.0\local\pgsql\lib\pgevent.dll

TypesSupported : error type message send by postgresql



Regsvr32 is a standard program located in %systemroot%\system32



Regards

Laurent Ballester




Re: eventlog fix

From
Bruce Momjian
Date:
OK, I have created the following diff to document the pgevent
installation instructions.  However, you didn't send me a Makefile for
creating the DLL, and I am not sure how to do that.  Would you send me a
`Makefile for src/bin/pgevent?  Thanks.

---------------------------------------------------------------------------

Laurent Ballester wrote:
> Hello,
>
> >
> > We don't use this hungarian notation anywhere ... it certainly looks
> > ugly.
> >
>
> Sorry, I modify pgevent.c again and suppress all hungarian variables naming.
>
> I add a diff -c for src/bin/Makefile, necessary to compile pgevent for
> windows platform.
>
>
> regards
>
> Laurent Ballester

[ Attachment, skipping... ]

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/installation.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/installation.sgml,v
retrieving revision 1.202
diff -c -c -r1.202 installation.sgml
*** doc/src/sgml/installation.sgml    23 May 2004 15:13:43 -0000    1.202
--- doc/src/sgml/installation.sgml    19 Jun 2004 05:12:09 -0000
***************
*** 1073,1078 ****
--- 1073,1091 ----
    </procedure>

    <formalpara>
+    <title>Registering <application>eventlog</> on <systemitem
+    class="osname">Windows</>:</title>
+    <para>
+     To register a <systemitem class="osname">Windows</> <application>eventlog</>
+     library with the operating system, issue this command after installation:
+ <screen>
+ <userinput>regsvr32 <replaceable>pgsql_library_directory</>/pgevent.dll</>
+ </screen>
+     This creates registry entries used by the event viewer.
+    </para>
+   </formalpara>
+
+   <formalpara>
     <title>Uninstallation:</title>
     <para>
      To undo the installation use the command <command>gmake
Index: src/bin/Makefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/Makefile,v
retrieving revision 1.44
diff -c -c -r1.44 Makefile
*** src/bin/Makefile    18 Jun 2004 21:24:05 -0000    1.44
--- src/bin/Makefile    19 Jun 2004 05:12:11 -0000
***************
*** 15,20 ****
--- 15,23 ----

  DIRS := initdb ipcclean pg_ctl pg_dump \
      psql scripts pg_config pg_controldata pg_resetxlog
+ ifeq ($(PORTNAME), win32)
+ DIRS+=pgevent
+ endif

  all install installdirs uninstall depend distprep:
      @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done

Re: eventlog fix

From
"Laurent Ballester"
Date:
Hello,

I just looking under CVS web interface what is stored in pgevent directory
and what is missing.

The files attached with this mail have to be stored in pgevent directory.
MSG000001.bin is a bin files, result of Microsoft MC compiler. MC compiler
can be downloaded for free with MS Core SDK but it is not included with MSYS
tools and I didn't find a alternative way to compile MC file.

To summarize MC pgmsgevent.mc command generates pgmsgevent.h pgmsgevent.rc
and MSG00001.bin files.
In MC file, we declare a string with %s format, so we can write anything we
want in the future without need to change the definition of this string.

To finish, because DllUnregisterServer and DllRegisterServer are system
defined entry point, we need to export these two functions with their names
without "decoration", so we cannot uses auto generated .def files without
handy modifications.

regards
Laurent Ballester

----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
<pgsql-patches@postgresql.org>
Sent: Saturday, June 19, 2004 7:13 AM
Subject: Re: [PATCHES] eventlog fix


>
> OK, I have created the following diff to document the pgevent
> installation instructions.  However, you didn't send me a Makefile for
> creating the DLL, and I am not sure how to do that.  Would you send me a
> `Makefile for src/bin/pgevent?  Thanks.
>

Attachment

Re: eventlog fix

From
Bruce Momjian
Date:
Woh, we aren't requring MS C to compile this feature.  Can't it be
created by mingw?  If not, I don't see what value an MS C compile is
going to do for us.

---------------------------------------------------------------------------

Laurent Ballester wrote:
> Hello,
>
> I just looking under CVS web interface what is stored in pgevent directory
> and what is missing.
>
> The files attached with this mail have to be stored in pgevent directory.
> MSG000001.bin is a bin files, result of Microsoft MC compiler. MC compiler
> can be downloaded for free with MS Core SDK but it is not included with MSYS
> tools and I didn't find a alternative way to compile MC file.
>
> To summarize MC pgmsgevent.mc command generates pgmsgevent.h pgmsgevent.rc
> and MSG00001.bin files.
> In MC file, we declare a string with %s format, so we can write anything we
> want in the future without need to change the definition of this string.
>
> To finish, because DllUnregisterServer and DllRegisterServer are system
> defined entry point, we need to export these two functions with their names
> without "decoration", so we cannot uses auto generated .def files without
> handy modifications.
>
> regards
> Laurent Ballester
>
> ----- Original Message -----
> From: "Bruce Momjian" <pgman@candle.pha.pa.us>
> To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
> Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
> <pgsql-patches@postgresql.org>
> Sent: Saturday, June 19, 2004 7:13 AM
> Subject: Re: [PATCHES] eventlog fix
>
>
> >
> > OK, I have created the following diff to document the pgevent
> > installation instructions.  However, you didn't send me a Makefile for
> > creating the DLL, and I am not sure how to do that.  Would you send me a
> > `Makefile for src/bin/pgevent?  Thanks.
> >

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: eventlog fix

From
"Magnus Hagander"
Date:
We require the MS "MC" compiler to build the BIN file (note - this is
not C - this is the "Message Compiler"). The Ccode should compile fine
in mingw.

Not requiring it is the reason we'd include the .BIN file in CVS. MC is
only needed to *rebuild* it.

//Magnus


>-----Original Message-----
>From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
>
>
>Woh, we aren't requring MS C to compile this feature.  Can't it be
>created by mingw?  If not, I don't see what value an MS C compile is
>going to do for us.
>
>---------------------------------------------------------------
>------------
>
>Laurent Ballester wrote:
>> Hello,
>>
>> I just looking under CVS web interface what is stored in
>pgevent directory
>> and what is missing.
>>
>> The files attached with this mail have to be stored in
>pgevent directory.
>> MSG000001.bin is a bin files, result of Microsoft MC
>compiler. MC compiler
>> can be downloaded for free with MS Core SDK but it is not
>included with MSYS
>> tools and I didn't find a alternative way to compile MC file.
>>
>> To summarize MC pgmsgevent.mc command generates pgmsgevent.h
>pgmsgevent.rc
>> and MSG00001.bin files.
>> In MC file, we declare a string with %s format, so we can
>write anything we
>> want in the future without need to change the definition of
>this string.
>>
>> To finish, because DllUnregisterServer and DllRegisterServer
>are system
>> defined entry point, we need to export these two functions
>with their names
>> without "decoration", so we cannot uses auto generated .def
>files without
>> handy modifications.
>>
>> regards
>> Laurent Ballester
>>
>> ----- Original Message -----
>> From: "Bruce Momjian" <pgman@candle.pha.pa.us>
>> To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
>> Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
>> <pgsql-patches@postgresql.org>
>> Sent: Saturday, June 19, 2004 7:13 AM
>> Subject: Re: [PATCHES] eventlog fix
>>
>>
>> >
>> > OK, I have created the following diff to document the pgevent
>> > installation instructions.  However, you didn't send me a
>Makefile for
>> > creating the DLL, and I am not sure how to do that.  Would
>you send me a
>> > `Makefile for src/bin/pgevent?  Thanks.
>> >
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>[ Attachment, skipping... ]
>
>--
>  Bruce Momjian                        |  http://candle.pha.pa.us
>  pgman@candle.pha.pa.us               |  (610) 359-1001
>  +  If your life is a hard drive,     |  13 Roberts Road
>  +  Christ can be your backup.        |  Newtown Square,
>Pennsylvania 19073
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to
>majordomo@postgresql.org
>

Re: eventlog fix

From
Andrew Dunstan
Date:
There is also this message compiler - I have no idea of the quality:

http://www.volny.cz/xnavara/SimpleMC.zip

I believe the WINE project also has one.

Putting the .bin file in CVS doesn't seem too horrible to me.

cheers

andrew


Magnus Hagander wrote:

>We require the MS "MC" compiler to build the BIN file (note - this is
>not C - this is the "Message Compiler"). The Ccode should compile fine
>in mingw.
>
>Not requiring it is the reason we'd include the .BIN file in CVS. MC is
>only needed to *rebuild* it.
>
>//Magnus
>
>
>
>
>>-----Original Message-----
>>From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
>>
>>
>>Woh, we aren't requring MS C to compile this feature.  Can't it be
>>created by mingw?  If not, I don't see what value an MS C compile is
>>going to do for us.
>>
>>---------------------------------------------------------------
>>------------
>>
>>Laurent Ballester wrote:
>>
>>
>>>Hello,
>>>
>>>I just looking under CVS web interface what is stored in
>>>
>>>
>>pgevent directory
>>
>>
>>>and what is missing.
>>>
>>>The files attached with this mail have to be stored in
>>>
>>>
>>pgevent directory.
>>
>>
>>>MSG000001.bin is a bin files, result of Microsoft MC
>>>
>>>
>>compiler. MC compiler
>>
>>
>>>can be downloaded for free with MS Core SDK but it is not
>>>
>>>
>>included with MSYS
>>
>>
>>>tools and I didn't find a alternative way to compile MC file.
>>>
>>>To summarize MC pgmsgevent.mc command generates pgmsgevent.h
>>>
>>>
>>pgmsgevent.rc
>>
>>
>>>and MSG00001.bin files.
>>>In MC file, we declare a string with %s format, so we can
>>>
>>>
>>write anything we
>>
>>
>>>want in the future without need to change the definition of
>>>
>>>
>>this string.
>>
>>
>>>To finish, because DllUnregisterServer and DllRegisterServer
>>>
>>>
>>are system
>>
>>
>>>defined entry point, we need to export these two functions
>>>
>>>
>>with their names
>>
>>
>>>without "decoration", so we cannot uses auto generated .def
>>>
>>>
>>files without
>>
>>
>>>handy modifications.
>>>
>>>regards
>>>Laurent Ballester
>>>
>>>----- Original Message -----
>>>From: "Bruce Momjian" <pgman@candle.pha.pa.us>
>>>To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
>>>Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
>>><pgsql-patches@postgresql.org>
>>>Sent: Saturday, June 19, 2004 7:13 AM
>>>Subject: Re: [PATCHES] eventlog fix
>>>
>>>
>>>
>>>
>>>>OK, I have created the following diff to document the pgevent
>>>>installation instructions.  However, you didn't send me a
>>>>
>>>>
>>Makefile for
>>
>>
>>>>creating the DLL, and I am not sure how to do that.  Would
>>>>
>>>>
>>you send me a
>>
>>
>>>>`Makefile for src/bin/pgevent?  Thanks.
>>>>
>>>>
>>>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>[ Attachment, skipping... ]
>>
>>--
>> Bruce Momjian                        |  http://candle.pha.pa.us
>> pgman@candle.pha.pa.us               |  (610) 359-1001
>> +  If your life is a hard drive,     |  13 Roberts Road
>> +  Christ can be your backup.        |  Newtown Square,
>>Pennsylvania 19073
>>
>>---------------------------(end of
>>broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to
>>majordomo@postgresql.org
>>
>>
>>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>

Re: eventlog fix

From
"Dave Page"
Date:


> -----Original Message-----
> From: pgsql-patches-owner@postgresql.org on behalf of Bruce Momjian
> Sent: Sat 6/19/2004 4:21 PM
> To: Laurent Ballester
> Cc: Alvaro Herrera; pgsql-patches@postgresql.org
> Subject: Re: [PATCHES] eventlog fix
>
>
> Woh, we aren't requring MS C to compile this feature.  Can't it be
> created by mingw?  If not, I don't see what value an MS C compile is
> going to do for us.

Mingw will not compile the message file, and without it there is no way of getting event log messages that aren't so
messythat they're virtually unreadable. 

Regards, Dave

Re: eventlog fix

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> We require the MS "MC" compiler to build the BIN file (note - this is
> not C - this is the "Message Compiler").

So is this tool readily available?  What does one have to do/buy to
lay hands on it?

> Not requiring it is the reason we'd include the .BIN file in CVS. MC is
> only needed to *rebuild* it.

I'd prefer to avoid having derived files like this in CVS.  We do not
keep any other derived files in CVS (except configure, which decision
seems more and more like a historical artifact).

            regards, tom lane

Re: eventlog fix

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-patches-owner@postgresql.org
> [mailto:pgsql-patches-owner@postgresql.org] On Behalf Of Tom Lane
> Sent: 19 June 2004 20:03
> To: Magnus Hagander
> Cc: Bruce Momjian; Laurent Ballester; pgsql-patches@postgresql.org
> Subject: Re: [PATCHES] eventlog fix
>
> "Magnus Hagander" <mha@sollentuna.net> writes:
> > We require the MS "MC" compiler to build the BIN file (note
> - this is
> > not C - this is the "Message Compiler").
>
> So is this tool readily available?  What does one have to
> do/buy to lay hands on it?

Download it from
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ (dunno how
that'll render outside of IE - it's part of an active setup thingy).
It's included with the Windows Platform SDK (which is free).

> > Not requiring it is the reason we'd include the .BIN file
> in CVS. MC
> > is only needed to *rebuild* it.
>
> I'd prefer to avoid having derived files like this in CVS.
> We do not keep any other derived files in CVS (except
> configure, which decision seems more and more like a
> historical artifact).

It's a very large download to get the SDK (180MB) - that's a lot of
bandwidth for one little derived file that will almost certainly never
change.

Regards, Dave.

Re: eventlog fix

From
Tom Lane
Date:
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> So is this tool readily available?  What does one have to
>> do/buy to lay hands on it?

> It's included with the Windows Platform SDK (which is free).

Oh, good.

> It's a very large download to get the SDK (180MB) - that's a lot of
> bandwidth for one little derived file that will almost certainly never
> change.

Hm, that is a lot ... but wouldn't the sort of people interested in
hacking PG on Windows likely already have it?

If you think not, I'll withdraw my objection to keeping the .BIN in CVS,
but I'm just wondering whether we're worrying about something that
hackers would have anyway.

            regards, tom lane

Re: eventlog fix

From
"Dave Page"
Date:

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 19 June 2004 22:49
> To: Dave Page
> Cc: Magnus Hagander; Bruce Momjian; Laurent Ballester;
> pgsql-patches@postgresql.org
> Subject: Re: [PATCHES] eventlog fix
>
> Hm, that is a lot ... but wouldn't the sort of people
> interested in hacking PG on Windows likely already have it?
>
> If you think not, I'll withdraw my objection to keeping the
> .BIN in CVS, but I'm just wondering whether we're worrying
> about something that hackers would have anyway.

I have mc.exe, but only because I have paid for Visual Studio. I don't
have the platform SDK installed, however I cannot honestly say whether
or not I would have it if I didn't have VS. I would include the file in
CVS if it were my choice - it's clearly a pain to download the compiler
if you don't have it, and the file is unlikely to need updating in the
future - it was designed to be a generic DLL that just formats any
message as '%s'.

Regards Dave.

Re: eventlog fix

From
Bruce Momjian
Date:
Dave Page wrote:
>
>
> > -----Original Message-----
> > From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> > Sent: 19 June 2004 22:49
> > To: Dave Page
> > Cc: Magnus Hagander; Bruce Momjian; Laurent Ballester;
> > pgsql-patches@postgresql.org
> > Subject: Re: [PATCHES] eventlog fix
> >
> > Hm, that is a lot ... but wouldn't the sort of people
> > interested in hacking PG on Windows likely already have it?
> >
> > If you think not, I'll withdraw my objection to keeping the
> > .BIN in CVS, but I'm just wondering whether we're worrying
> > about something that hackers would have anyway.
>
> I have mc.exe, but only because I have paid for Visual Studio. I don't
> have the platform SDK installed, however I cannot honestly say whether
> or not I would have it if I didn't have VS. I would include the file in
> CVS if it were my choice - it's clearly a pain to download the compiler
> if you don't have it, and the file is unlikely to need updating in the
> future - it was designed to be a generic DLL that just formats any
> message as '%s'.

Agreed.  We have to include the .bin file because if we don't, we would
have an additional Win32 depenency beyond Mingw.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: eventlog fix

From
Bruce Momjian
Date:
Patch applied, with doc additions I already posted.  Please test CVS and
let me know how it works.  I added a README containing your explaination
below for our later reference.  I added the MSG000001.bin as a binary
CVS checkin.

---------------------------------------------------------------------------

Laurent Ballester wrote:
> Hello,
>
> I just looking under CVS web interface what is stored in pgevent directory
> and what is missing.
>
> The files attached with this mail have to be stored in pgevent directory.
> MSG000001.bin is a bin files, result of Microsoft MC compiler. MC compiler
> can be downloaded for free with MS Core SDK but it is not included with MSYS
> tools and I didn't find a alternative way to compile MC file.
>
> To summarize MC pgmsgevent.mc command generates pgmsgevent.h pgmsgevent.rc
> and MSG00001.bin files.
> In MC file, we declare a string with %s format, so we can write anything we
> want in the future without need to change the definition of this string.
>
> To finish, because DllUnregisterServer and DllRegisterServer are system
> defined entry point, we need to export these two functions with their names
> without "decoration", so we cannot uses auto generated .def files without
> handy modifications.
>
> regards
> Laurent Ballester
>
> ----- Original Message -----
> From: "Bruce Momjian" <pgman@candle.pha.pa.us>
> To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
> Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
> <pgsql-patches@postgresql.org>
> Sent: Saturday, June 19, 2004 7:13 AM
> Subject: Re: [PATCHES] eventlog fix
>
>
> >
> > OK, I have created the following diff to document the pgevent
> > installation instructions.  However, you didn't send me a Makefile for
> > creating the DLL, and I am not sure how to do that.  Would you send me a
> > `Makefile for src/bin/pgevent?  Thanks.
> >

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: eventlog fix

From
"Laurent Ballester"
Date:
Hello,

I downloaded and compiled all files you store in CVS pgevent directory and
it works.

Following the discusion posted yesterday, I made a test with SimpleMC a
alternative MC compiler ( http://www.volny.cz/xnavara/SimpleMC.zip) but
unfortunatelly it doesn't works MSG0001.bin file generated are differents
and consequently Messages are seing missing for Windows eventviewer.

regards
Laurent Ballester

----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Laurent Ballester" <postgresql.ballester@wanadoo.fr>
Cc: "Alvaro Herrera" <alvherre@dcc.uchile.cl>;
<pgsql-patches@postgresql.org>
Sent: Sunday, June 20, 2004 3:33 AM
Subject: Re: [PATCHES] eventlog fix


>
> Patch applied, with doc additions I already posted.  Please test CVS and
> let me know how it works.  I added a README containing your explaination
> below for our later reference.  I added the MSG000001.bin as a binary
> CVS checkin.
>