pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Creager, Robert S <CreagRS@LOUISVILLE.STORTEK.COM>
Cc: 'SQL - PGSQL' <pgsql-sql@postgresql.org>
Subject: Re: cannot get CREATE TABLE AS to work
Date: Fri, 9 Mar 2001 17:52:30 +0100 (CET)
Message-ID: <Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain> (raw)
In-Reply-To: <10FE17AD5F7ED31188CE002048406DE8514CDD@lsv-msg06.stortek.com>

Creager, Robert S writes:

> 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"

Either you have an AS clause, or a column list, not both.

> 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?

Quite likely.  Also make sure you wrap the inserts into a BEGIN/COMMIT
block.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/




view thread (10+ messages)  latest in thread

Message-ID: <Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain>
Permalink:  ../Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain/
Also on:    postgresql.org/message-id/Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain

 · 

reply

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: peter_e@gmx.net, CreagRS@LOUISVILLE.STORTEK.COM
  Subject: Re: cannot get CREATE TABLE AS to work
  In-Reply-To: <Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain>
  References: <10FE17AD5F7ED31188CE002048406DE8514CDD@lsv-msg06.stortek.com> <Pine.LNX.4.30.0103091751280.929-100000@peter.localdomain>

* 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