Search Postgresql Archives

Re: Re: Error on Windows server could not open relation base/xxx/xxx Permission denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 13, 2010 at 5:11 AM, Craig Ringer
<craig@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On 13/06/10 02:34, Adrian Klaver wrote:
>
>>> Question: Is it possible that there's corruption in the database which is
>>> being incorrectly reported as "Permission denied"?
>
> It's certainly not impossible. It'd really help if Pg would print more
> details from Windows' error reporting - GetLastError() etc - in cases
> like this. In fact, some searching reveals complaints about just that as
> far back as mid-2008 related to the exact error you're encountering.

It does if you enable debug logging. DEBUG5 is required from what I
can tell (see src/port/win32error.c, function _dosmaperr(), which is
called from pgwin32_open()).

In a lot of cases it maps straight over, but in the cases where we
have to map to an errno value and use that, there can be more than
one. In the case of access denied, it can be:
ERROR_ACCESS_DENIED
ERROR_CURRENT_DIRECTORY
ERROR_LOCK_VIOLATION
ERROR_SHARING_VIOLATION (but this is taken care of already in pgwin32_open)
ERROR_NETWORK_ACCESS_DENIED
ERROR_CANNOT_MAKE
ERROR_FAIL_I24
ERROR_DRIVE_LOCKED
ERROR_SEEK_ON_DEVICE
ERROR_NOT_LOCKED
ERROR_LOCK_FAILED

Most of these can't (shouldn't be possible at least) appear when we're
opening a file for reading. But it'd be interesting to know what they
were.

So it'd be interesting to see the output of this at DEBUG5 (there
should be a line saying "mapped win32 error code <n> to <n>" showing
up - there will be *tons* of other logging output of course)


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux