CREATE DATABASE with tablespace fix

Поиск
Список
Период
Сортировка
От Gavin Sherry
Тема CREATE DATABASE with tablespace fix
Дата
Msg-id Pine.LNX.4.58.0408081654020.18795@linuxworld.com.au
обсуждение исходный текст
Ответы Re: CREATE DATABASE with tablespace fix  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: CREATE DATABASE with tablespace fix  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Attached is a patch resolving the issue raised here:


http://groups.google.com.au/groups?q=tablespaces+group:comp.databases.postgresql.hackers&hl=en&lr=&ie=UTF-8&group=comp.databases.postgresql.hackers&scoring=d&selm=Pine.LNX.4.58.0407281411470.17889%40linuxworld.com.au&rnum=4

When I was testing this, I noticed the following:

template1=# create tablespace blah location '/home/gavins/pgsql/blah';
CREATE TABLESPACE
template1=# create table foo(i int) tablespace blah;
CREATE TABLE
template1=# create database bar tablespace blah;
ERROR:  template database "template1" is already using tablespace "blah"
DETAIL:  The default tablespace for a database cannot be in use by the
template
database
template1=# drop table foo;
DROP TABLE
template1=# create database bar tablespace blah;
ERROR:  template database "template1" is already using tablespace "blah"
DETAIL:  The default tablespace for a database cannot be in use by the
template database

This happens because even though we drop the only entry in the tablespace
we keep the empty database directory around.

Should be test if the directory is empty and if so, not copy it (perhaps
only if it is in the tablespace which will be the default tablespace of
the new database?)

Gavin

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Small addition to syslogger.c
Следующее
От: Josh Berkus
Дата:
Сообщение: Postgresql.conf Documentation change