Обсуждение: Newbie cannot create tablespace

Поиск
Список
Период
Сортировка

Newbie cannot create tablespace

От
Richard Sickler
Дата:
Hi List,

I'm trying to create a tablespace using the following command copied
from pg_dumpall,

CREATE TABLESPACE test OWNER postgres LOCATION 'd:/prodb';

I receive the following message

ERROR:  directory "d:/proddb" is not empty

a \db yields

List of tablespaces
Name        |   Owner      |     Location
----------------------------------------------
pg_default    postgres
pg_global     postgres
(2 rows)

More background.
I had a Postgres 8.3.7 database at d:/prodb at one time.  It was working fine.
I decided to blow 8.3.7 it away and install 8.4.1.  (I'm running on
windows Server 2008 and I was getting shared memory errors).

After running the 8.4.1 one step installer , I used mklink /d to make
links replacing pg_log, pg_clog, and pg_xlog in d:/proddb, to
correspondingly named folders on c:\postgres, (worked fine on 8.3.7).
I used pg_dumpall on my test system with the intent of using pgsql -f
db.out as a way to load the 8.4.1 database.

But, I can't get pass the first step in the restore - namely the
CREATE TABLESPACE command above.

Any help would be appreciated.  Thank you.

Rich

Re: Newbie cannot create tablespace

От
Scott Marlowe
Дата:
On Mon, Nov 9, 2009 at 3:12 PM, Richard Sickler
<richard.sickler@avagotech.com> wrote:
> Hi List,
>
> I'm trying to create a tablespace using the following command copied
> from pg_dumpall,
>
> CREATE TABLESPACE test OWNER postgres LOCATION 'd:/prodb';
>
> I receive the following message
>
> ERROR:  directory "d:/proddb" is not empty
>
> a \db yields
>
> List of tablespaces
> Name        |   Owner      |     Location
> ----------------------------------------------
> pg_default    postgres
> pg_global     postgres
> (2 rows)
>
> More background.
> I had a Postgres 8.3.7 database at d:/prodb at one time.  It was working fine.
> I decided to blow 8.3.7 it away and install 8.4.1.  (I'm running on
> windows Server 2008 and I was getting shared memory errors).
>
> After running the 8.4.1 one step installer , I used mklink /d to make
> links replacing pg_log, pg_clog, and pg_xlog in d:/proddb, to
> correspondingly named folders on c:\postgres, (worked fine on 8.3.7).
> I used pg_dumpall on my test system with the intent of using pgsql -f
> db.out as a way to load the 8.4.1 database.
>
> But, I can't get pass the first step in the restore - namely the
> CREATE TABLESPACE command above.

A tablespace directory must be empty to create tablespace on it. Just
make a subdir like d:\proddb\tbspc and create tablespace on that.

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

Re: Newbie cannot create tablespace

От
Scott Marlowe
Дата:
On Mon, Nov 9, 2009 at 3:12 PM, Richard Sickler
<richard.sickler@avagotech.com> wrote:
> Hi List,
>
> I'm trying to create a tablespace using the following command copied
> from pg_dumpall,
>
> CREATE TABLESPACE test OWNER postgres LOCATION 'd:/prodb';
>
> I receive the following message
>
> ERROR:  directory "d:/proddb" is not empty
>
> a \db yields
>
> List of tablespaces
> Name        |   Owner      |     Location
> ----------------------------------------------
> pg_default    postgres
> pg_global     postgres
> (2 rows)
>
> More background.
> I had a Postgres 8.3.7 database at d:/prodb at one time.  It was working fine.
> I decided to blow 8.3.7 it away and install 8.4.1.  (I'm running on
> windows Server 2008 and I was getting shared memory errors).
>
> After running the 8.4.1 one step installer , I used mklink /d to make
> links replacing pg_log, pg_clog, and pg_xlog in d:/proddb, to
> correspondingly named folders on c:\postgres, (worked fine on 8.3.7).
> I used pg_dumpall on my test system with the intent of using pgsql -f
> db.out as a way to load the 8.4.1 database.
>
> But, I can't get pass the first step in the restore - namely the
> CREATE TABLESPACE command above.

A tablespace directory must be empty to create tablespace on it. Just
make a subdir like d:\proddb\tbspc and create tablespace on that.

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