From: Tom Lane <tgl@sss.pgh.pa.us>
To: r d <rd0002@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Feature Request (and/or possible bug) re Default Tablespaces
Date: Fri, 29 Jun 2012 19:10:08 -0400
Message-ID: <25717.1341011408@sss.pgh.pa.us> (raw)
In-Reply-To: <CALtFtE+SntZtMJUbX03RT8WgZgEUziAkQvX=SL=AupjT_v8hwA@mail.gmail.com>
References: <CALtFtE+SntZtMJUbX03RT8WgZgEUziAkQvX=SL=AupjT_v8hwA@mail.gmail.com>
r d <rd0002@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rd0002@gmail.com
Subject: Re: Feature Request (and/or possible bug) re Default Tablespaces
In-Reply-To: <25717.1341011408@sss.pgh.pa.us>
References: <CALtFtE+SntZtMJUbX03RT8WgZgEUziAkQvX=SL=AupjT_v8hwA@mail.gmail.com> <25717.1341011408@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox