From: Creager, Robert S <CreagRS@LOUISVILLE.STORTEK.COM>
To: 'SQL - PGSQL' <pgsql-sql@postgresql.org>
Subject: cannot get CREATE TABLE AS to work
Date: Fri, 9 Mar 2001 09:21:32 -0700
Message-ID: <10FE17AD5F7ED31188CE002048406DE8514CDD@lsv-msg06.stortek.com> (raw)
I'm sure I'm doing something wrong, and I'm hoping someone can show me the
way of things. Running 7.1beta5 on an Ultra 5, Solaris 2.6 w/256Mb mem. If
I remove the AS, the table creates correctly and I can do the INSERT INTO
with the SELECT clause
psql -d tassiv -c "\
create table observationsII ( \
ra float8 not null, \
decl float8 not null, \
mag float8 not null, \
smag float8 not null, \
obs_id serial, \
file_id int4 references files on delete cascade, \
star_id int4 references comp_loc on delete set null default null ) \
AS select o.ra, o.decl, o.mag, o.smag, o.file_id from
observations o"
ERROR: parser: parse error at or near "AS"
And the next question, should this really be taking 3 hours to insert 315446
records? I noticed the disk is basically idle during the few times when I
watched. Would this be because of the index created on obs_id?
time psql -d tassiv -c "insert into observationsII( ra, decl, mag, smag,
file_id ) select ra, decl, mag, smag, file_id from observations"
INSERT 0 315446
0.01u 0.01s 3:13:22.39 0.0%
Robert Creager
Senior Software Engineer
Client Server Library
303.673.2365 V
303.661.5379 F
888.912.4458 P
StorageTek
INFORMATION made POWERFUL
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-sql@postgresql.org
Cc: CreagRS@LOUISVILLE.STORTEK.COM
Subject: Re: cannot get CREATE TABLE AS to work
In-Reply-To: <10FE17AD5F7ED31188CE002048406DE8514CDD@lsv-msg06.stortek.com>
References: <10FE17AD5F7ED31188CE002048406DE8514CDD@lsv-msg06.stortek.com>
* 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