pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCREATE TABLE AS and tablespaces
2+ messages / 2 participants
[nested] [flat]
* CREATE TABLE AS and tablespaces
@ 2006-02-24 10:45 Markus Schaber <schabi@logix-tt.com>
2006-02-25 04:51 ` Re: CREATE TABLE AS and tablespaces Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Markus Schaber @ 2006-02-24 10:45 UTC (permalink / raw)
To: pgsql-sql
Hello,
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.
Thanks,
Schabi
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: CREATE TABLE AS and tablespaces
2006-02-24 10:45 CREATE TABLE AS and tablespaces Markus Schaber <schabi@logix-tt.com>
@ 2006-02-25 04:51 ` Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Momjian @ 2006-02-25 04:51 UTC (permalink / raw)
To: Markus Schaber <schabi@logix-tt.com>; +Cc: pgsql-sql
Markus Schaber wrote:
> Hello,
>
> 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.
This feature will be in 8.2:
revision 2.530
date: 2006/02/19 00:04:27; author: neilc; state: Exp; lines: +16 -20
Add TABLESPACE and ON COMMIT clauses to CREATE TABLE AS. ON COMMIT is
required by the SQL standard, and TABLESPACE is useful functionality.
Patch from Kris Jurka, minor editorialization by Neil Conway.
--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-02-25 04:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-24 10:45 CREATE TABLE AS and tablespaces Markus Schaber <schabi@logix-tt.com>
2006-02-25 04:51 ` Bruce Momjian <pgman@candle.pha.pa.us>
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