Re: Feature Request (and/or possible bug) re Default Tablespaces

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: r d <rd0002(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Feature Request (and/or possible bug) re Default Tablespaces
Date: 2012-06-29 23:10:08
Message-ID: 25717.1341011408@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

r d <rd0002(at)gmail(dot)com> writes:
> My Database C1 definition:

> CREATE DATABASE "C1" ...
> TABLESPACE = "C1"

> After these two statements, tablespace C1 should be the default tablespace
> for storing all objects in database C1, meaning that when I do not specify
> a tablespace, objects are stored there. Right?

Right.

> I now proceed to do:

> CREATE TABLE "TEMP1"
> (
> "ID" bigint NOT NULL,
> CONSTRAINT "PK_TEMP1" PRIMARY KEY ("ID" )
> );

> That makes a table "TEMP1" in tablespace C1. Ok so far.
> *But it creates the index of the PK in tablespace "pg_default" !!!*

Um ... not for me. AFAICS, nothing is created under $PGDATA/base
when I do this. And both the table and the index show up in pg_class
with reltablespace = 0:

d1=# select relname,reltablespace from pg_class where relname like '%TEMP%';
relname | reltablespace
----------+---------------
TEMP1 | 0
PK_TEMP1 | 0
(2 rows)

which is the correct way of indicating they belong to the database's
default tablespace. Are you perhaps misinterpreting the zero as meaning
they'll be in pg_default?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2012-06-30 01:54:30 Re: BUG #6706: pg_upgrade fails when plpgsql dropped/re-created
Previous Message r d 2012-06-29 19:49:57 Feature Request (and/or possible bug) re Default Tablespaces