Re: BUG #6735: PANIC: 42501: could not open control file "global/pg_control": Permission denied

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: Petros Tsialiamanis <tsialiam(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6735: PANIC: 42501: could not open control file "global/pg_control": Permission denied
Date: 2012-07-14 05:20:53
Message-ID: 4813.1342243253@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> writes:
> PostgreSQL 9.1 isn't compatible with databases from 8.3, so you can't
> actually run Pg 9.1 directly against a datadir from 8.3; that's why I
> suggested the latest 8.3 point release.

> However, your startup should be failing with a message telling you this,
> not with a permissions error then (more importantly) a crash.

Well, the reason that's a PANIC is that ReadControlFile is coded that
way:

fd = BasicOpenFile(XLOG_CONTROL_FILE,
O_RDWR | PG_BINARY,
S_IRUSR | S_IWUSR);
if (fd < 0)
ereport(PANIC,
(errcode_for_file_access(),
errmsg("could not open control file \"%s\": %m",
XLOG_CONTROL_FILE)));

Perhaps it should be only FATAL instead, but that seems like a quibble.
If it can't read pg_control, the server ain't starting.

It is curious though that the OP gets this far, because the server
would previously have tried to read PG_VERSION and postgresql.conf,
which if it were a simple wrong-account problem should likewise
have been unreadable. Your thought about AV software may be the
right explanation.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message dsavolainen 2012-07-14 17:44:52 BUG #6738: pg_dump does not handle extensions properly/invalid pg_dump output
Previous Message John R Pierce 2012-07-14 05:19:04 Re: BUG #6735: PANIC: 42501: could not open control file "global/pg_control": Permission denied