Re: pg_castalog.pg_tables does not show the real tablespace for tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "J(dot) Carlos Muro" <murojc(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_castalog.pg_tables does not show the real tablespace for tables
Date: 2009-04-07 14:33:46
Message-ID: 1461.1239114826@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"J. Carlos Muro" <murojc(at)gmail(dot)com> writes:
> I have created a tablespace and a database in that tablespace:

> create tablespace tb_user location '/data/tb_user';
> create database mydatabase tablespace "tb_user";
> \c mydatabase;
> create table a_table (id bigint, name text);

> I supposed that "a_table" should be in the tablespace "tb_user" as the
> database was created to use it by default. But I doesnt seem like that when
> i state the next:

The database's default tablespace is never named explicitly in pg_tables
nor in the underlying pg_class catalog. This is intentional to make it
easier to move a database to a different default tablespace.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Charles N. Charotti 2009-04-07 16:23:06 Text vs. Varchar talking about performance
Previous Message J. Carlos Muro 2009-04-07 11:23:57 pg_castalog.pg_tables does not show the real tablespace for tables