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/