On Mon, Jan 20, 2014 at 4:05 AM, MauMau <maumau...@gmail.com> wrote:
> From: "Amit Kapila" <amit.kapil...@gmail.com>
>> Today, I was trying to reproduce this issue and found that if user tries
>> to register event source second time with same name, we just replace
>> the previous event source's path in registry.
>> Shouldn't we try to stop user at this step only, means if he tries to
>> register with same event source name more than once return error,
>> saying event source with same name already exists?
> I'm OK with either.  If we add the check, I think that would be another
> patch.

   Do you think without this the problem reported by you is resolved completely.
   User can hit same problem, if he tries to follow similar steps mentioned in
   your first mail. I had tried below steps based on description in your
   first mail:

1. installation of PostgreSQL from source code (master) using Install.bat in
    msvc directory
2. initdb -D <data_dir>
3. regsvr32 /n /i:PostgreSQL <install_dir_path>\lib\pgevent.dll
4. Modify postgresql.conf to set log_destination= 'eventlog'
5. event_source = 'PostgreSQL'
6. pg_ctl.exe start -D ..\..\Data
7. psql -d postgres
8. Drop table t1; --try dropping some non-existant table
9. Check in Event viewer, you can find proper error.
10. NO Problem till above step.
11. Installation of PostgreSQL from source code (9.2) using Install.bat in
    msvc directory
12. initdb -D <9.2_data_dir>
13. regsvr32 /n /i:PostgreSQL <install_9.2_dir_path>\lib\pgevent.dll
14. Remove 9.2 installation (i have just renamed the install folder)
15. now perform step 8 again on master (with or without restart of server)
16. Open Event Viewer, you can see the message
     "event source not found"

Now this could have been avoided, if in step-13 we use different
event source name, but I think that will happen even without
this patch.

> However, I'm afraid the check won't be much effective, because the
> packaged application then unregister and register (i.e. regsvr32 /u and then
> regsvr32 /i) blindly.

If user register/unregister different versions of pgevent.dll blindly,
then I think
any fix in this area could not prevent the error "event source not found"

>> Another thing is after register of pgevent.dll, if I just try to start
>> PostgreSQL
>> it shows below messages in EventLog. Although the message has information
>> about server startup, but the start of Description is something similar to
>> what you were reporting "event source not found".
>> Am I missing something?
>> Steps
>> 1. installation of PostgreSQL from source code using Install.bat in
>> mdvc directory
>> 2. initdb -D <data_dir>
>> 3. regsvr32 /n /i:PostgreSQL <install_dir_path>\lib\pgevent32.dll
> Please specify pgevent.dll, not pgevent32.dll.

Typo, I was using prevent.dll only, I think the reason is I need to restart
Event Viewer after register command.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to