pgsql: Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase

Started by Tom Laneover 20 years ago4 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messages
conform to style guide. Per old suggestion from Qingqing Zhou, which
seems to have gotten lost in the shuffle.

Modified Files:
--------------
pgsql/src/backend/port/win32:
error.c (r1.4 -> r1.5)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/port/win32/error.c.diff?r1=1.4&r2=1.5)

#2Qingqing Zhou
zhouqq@cs.toronto.edu
In reply to: Tom Lane (#1)
Re: pgsql: Recognize ERROR_SHARING_VIOLATION (translate to EACCES),

"Tom Lane" <tgl@svr1.postgresql.org> wrote

Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messages
conform to style guide.

This patch does not really work. This is because when mdread()/mdwrite()
fails, it does *not* call our own _dosmaperr() routine. Instead, it calls
the Win32 CRT's _dosmapperr() to do the translation (which fails to
translate ERROR_SHARING_VIOLATION either). If we want our _dosmaperr() to
play role in, we have to call it explicitely in mdread()/mdwrite() or
lower levels like FileRead()/FileWrite().

I would suggest don't revert this patch. When we get the feedback from
Jean-Pierre Pelletier, we can make the patch complete.

Regards,
Qingqing

#3Qingqing Zhou
zhouqq@cs.toronto.edu
In reply to: Tom Lane (#1)
Re: pgsql: Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase

"Tom Lane" <tgl@svr1.postgresql.org> wrote

Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messages
conform to style guide.

This patch does not really work. This is because when mdread()/mdwrite()
fails, it does *not* call our own _dosmaperr() routine. Instead, it calls
the Win32 CRT's _dosmapperr() to do the translation (which fails to
translate ERROR_SHARING_VIOLATION either). If we want our _dosmaperr() to
play role in, we have to call it explicitely in mdread()/mdwrite() or lower
levels like FileRead()/FileWrite().

I would suggest don't revert this patch. When we get the feedback from
Jean-Pierre Pelletier, we can make the patch complete.

Regards,
Qingqing

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Qingqing Zhou (#2)
Re: pgsql: Recognize ERROR_SHARING_VIOLATION (translate to EACCES),

Qingqing Zhou <zhouqq@cs.toronto.edu> writes:

"Tom Lane" <tgl@svr1.postgresql.org> wrote

Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messages
conform to style guide.

This patch does not really work. This is because when mdread()/mdwrite()
fails, it does *not* call our own _dosmaperr() routine.

Agreed, it does not help mdread, but it's still an improvement.

regards, tom lane