pg_resetxlog defect with relative database path
Haribabu kommi <haribabu.kommi@huawei.com>
From: Hari Babu <haribabu.kommi@huawei.com>
To: "'PostgreSQL-development'" <pgsql-hackers@postgresql.org>
Date: 2012-11-22T13:22:27Z
Lists: pgsql-hackers
When I was testing pg_resetxlog with relative database path,
The pg_resetxlog is doing the transaction log reset even when the server is
running.
Steps to reproduce:
1. ./pg_ctl -D ../../data start
2. ./pg_resetxlog -f ../../data -- is not able to detect as server
is already running.
Please find the patch for the same:
*** a/src/bin/pg_resetxlog/pg_resetxlog.c
--- b/src/bin/pg_resetxlog/pg_resetxlog.c
***************
*** 254,260 **** main(int argc, char *argv[])
*/
snprintf(path, MAXPGPATH, "%s/postmaster.pid", DataDir);
! if ((fd = open(path, O_RDONLY, 0)) < 0)
{
if (errno != ENOENT)
{
--- 254,260 ----
*/
snprintf(path, MAXPGPATH, "%s/postmaster.pid", DataDir);
! if ((fd = open("postmaster.pid", O_RDONLY, 0)) < 0)
{
if (errno != ENOENT)
{
Any suggestions/comments?
Regards,
Hari babu.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
In psql, if the is no connection object, e.g. due to a server crash,
- fe21fcaf8d91 9.3.0 cited