Create database and tablespaces

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Create database and tablespaces
Date: 2004-07-28 04:17:35
Message-ID: Pine.LNX.4.58.0407281411470.17889@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

We have the following:

template1=# create tablespace blah location '/home/swm/tbl/tspc1/';
CREATE TABLESPACE
template1=# create table foo (i int) tablespace blah;
CREATE TABLE
template1=# create database foo tablespace blah;
ERROR: could not initialize database directory
DETAIL: Directory "/home/swm/tbl/data/pg_tblspc/17227/17230" already
exists.

The comment in dbcommands.c makes it clear that we don't want to allow
situations where the template database has entries in the target
database's default database but the error message is rather unhelpful. I
think that this also needs to be documented.

The question is, should we check if the template database has a non empty
directory under the target database's default database rather than let it
come through to this.

Gavin

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2004-07-28 04:38:34 Re: casting strings to multidimensional arrays yields strange
Previous Message Christopher Kings-Lynne 2004-07-28 03:44:28 Interesting bug in tablespaces