Re: Specifying xlog directory during initdb is failing

Lists: pgsql-bugs
From: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Specifying xlog directory during initdb is failing
Date: 2008-06-01 21:48:18
Message-ID: 1212356898.3119.17.camel@laptop.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

I was testing -X option, and I cannot make it work. This is PostgreSQL
8.3.1 on Fedora 9:
==========================================================

-bash-3.2$ initdb -d -X xlog/ -D data/
Running in debug mode.
VERSION=8.3.1
PGDATA=data
share_path=/usr/share/pgsql
PGPATH=/usr/bin
POSTGRES_SUPERUSERNAME=postgres
POSTGRES_BKI=/usr/share/pgsql/postgres.bki
POSTGRES_DESCR=/usr/share/pgsql/postgres.description
POSTGRES_SHDESCR=/usr/share/pgsql/postgres.shdescription
POSTGRESQL_CONF_SAMPLE=/usr/share/pgsql/postgresql.conf.sample
PG_HBA_SAMPLE=/usr/share/pgsql/pg_hba.conf.sample
PG_IDENT_SAMPLE=/usr/share/pgsql/pg_ident.conf.sample
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

creating directory data ... ok
creating directory xlog/ ... ok
creating subdirectories ... initdb: could not create directory "data/pg_xlog": File exists
initdb: removing data directory "data"
initdb: removing transaction log directory "xlog"

==========================================================

Am I missing something here? If not, this is a bug I believe.

Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 02:27:25
Message-ID: 811.1212373645@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= <devrim(at)CommandPrompt(dot)com> writes:
> I was testing -X option, and I cannot make it work. This is PostgreSQL
> 8.3.1 on Fedora 9:

> -bash-3.2$ initdb -d -X xlog/ -D data/

The root of the problem is that you can't use a relative path for -X:
it's not clear whether the path is relative to $PGDATA or the working
directory when you invoked initdb, and different bits of initdb
effectively make each of those assumptions. I agree that the failure
mode is pretty opaque :-(. I think the simplest solution is to reject
non-absolute path for -X; is there any real use-case for allowing it?

regards, tom lane


From: Andrew Sullivan <ajs(at)commandprompt(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 02:57:08
Message-ID: 20080602025708.GD57164@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Sun, Jun 01, 2008 at 10:27:25PM -0400, Tom Lane wrote:
> mode is pretty opaque :-(. I think the simplest solution is to reject
> non-absolute path for -X; is there any real use-case for allowing it?

No.

A

--
Andrew Sullivan
ajs(at)commandprompt(dot)com
+1 503 667 4564 x104
http://www.commandprompt.com/


From: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 05:09:20
Message-ID: 1212383360.2898.2.camel@laptop.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Sun, 2008-06-01 at 22:27 -0400, Tom Lane wrote:
> I think the simplest solution is to reject non-absolute path for -X;
> is there any real use-case for allowing it?

I don't think so.

Thanks for the patch -- could you please update docs (and man page) as
well? There are no words regarding using absolute path there, AFAICS.

Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 05:16:52
Message-ID: 3285.1212383812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= <devrim(at)CommandPrompt(dot)com> writes:
> On Sun, 2008-06-01 at 22:27 -0400, Tom Lane wrote:
>> I think the simplest solution is to reject non-absolute path for -X;
>> is there any real use-case for allowing it?

> I don't think so.

> Thanks for the patch -- could you please update docs (and man page) as
> well? There are no words regarding using absolute path there, AFAICS.

Don't you think the error message will be sufficient?

regards, tom lane


From: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 05:21:17
Message-ID: 1212384077.2898.7.camel@laptop.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Mon, 2008-06-02 at 01:16 -0400, Tom Lane wrote:
> > Thanks for the patch -- could you please update docs (and man page)
> as
> > well? There are no words regarding using absolute path there,
> AFAICS.
>
> Don't you think the error message will be sufficient?

I would not even try using non-absolute directory if it was specified in
the docs ;)

Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/


From: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Specifying xlog directory during initdb is failing
Date: 2008-06-02 05:40:39
Message-ID: 1212385239.2898.14.camel@laptop.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Mon, 2008-06-02 at 08:21 +0300, Devrim GÜNDÜZ wrote:
> > Don't you think the error message will be sufficient?
>
> I would not even try using non-absolute directory if it was specified
> in the docs ;)

BTW: We do allow non-absolute directory names for $PGDATA, but don't
allow for xlogs -- it does not look consistent. That's why I'm asking
for a doc update.

Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/