Re: Tablespace Default Behavior

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: harpagornis <shenlong(at)runbox(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tablespace Default Behavior
Date: 2017-03-30 15:04:20
Message-ID: 0ea76052-95d9-f222-933d-4c0853692518@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/30/2017 07:35 AM, harpagornis wrote:
> In PgAdmin, when I right-click the table, in the Properties pane on the right
> side of the screen, the tablespace is listed as "pg_default"

What we know. Correct me if I am wrong:

1) In postgresql.conf you have:
default_tablespace = ''

2) You created a table in the database:

CREATE TABLE myschema.mytable (rc_id integer NOT NULL) TABLESPACE
my_space;

FYI, the TABLESPACE is redundant as the table would created in my_space
anyway as it is the default for the database

3) When you queried pg_tables, the tablespace field is NULL for the
table. Which would be correct:
https://www.postgresql.org/docs/9.6/static/catalogs.html
tablespace name pg_tablespace.spcname Name of tablespace containing
table (null if default for database)

4) pgAdmin shows the tablespace as being pg_default for the table.

What we do not know:

1) Postgres version

2) pgAdmin version

3) select spcname from pg_database join pg_tablespace on
pg_database.dattablespace=pg_tablespace.oid where datname= your_db_name;

>
>
>
> --
> View this message in context: http://www.postgresql-archive.org/Tablespace-Default-Behavior-tp5952910p5953028.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message harpagornis 2017-03-30 15:36:05 Re: Tablespace Default Behavior
Previous Message Tom Lane 2017-03-30 14:57:19 Re: Unexpected interval comparison