Skip site navigation (1) Skip section navigation (2)

CREATE TABLE AS and tablespaces

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: CREATE TABLE AS and tablespaces
Date: 2006-02-24 10:45:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

Recently, I wanted to create a table from a complex query in a specific
tablespace, but CREATE TABLE name AS SELECT ... does not accept a
tablespace argument.

I worked around it by CREATE TABLE name AS SELECT ... LIMIT 0, then
moving the generated table to the other tablespace using ALTER TABLE,
and then using INSERT INTO ... SELECT to generate the data into the table.

But nevertheless, I'd like to ask here whether there are specific
reasons for omitting the tablespace argument from the CREATE TABLE AS
statement. If not, I'd like to request this minor feature :-)

Maybe it is even possible to further unify CREATE TABLE and CREATE TABLE AS.

Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU!


pgsql-sql by date

Next:From: Richard CDate: 2006-02-24 11:29:16
Subject: dbLink Query
Previous:From: Daniel JooDate: 2006-02-24 01:45:03
Subject: how to add primary key to existing table with multiple primary keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group