Odd error message: insert into...select from ...

Started by The Hermit Hackeralmost 27 years ago1 messages
#1The Hermit Hacker
scrappy@hub.org

This is in v6.4 ...

surveys=> create table systems (
surveys-> operating_system text,
surveys-> count int4 );
CREATE
surveys=> insert into systems
surveys-> select sys_type,count(sys_type)
surveys-> from op_sys
surveys-> where sys_type is not null
surveys-> group by sys_type;
ERROR: insert: more expressions than target columns
surveys=> \d systems

Table    = systems
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| operating_system                 | text                             |   var |
| count                            | int4                             |     4 |
+----------------------------------+----------------------------------+-------+

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org