The following bug has been logged online:
Bug reference: 6095
Logged by: Gavin Flower
Email address: gavin(dot)flower(at)archidevsys(dot)co(dot)nz
PostgreSQL version: 9.1beta2
Operating system: x86_64 Linux
Description: Misleading error message: INSERT has more expressions
than target columns
Using pg 9.1beta2 compiled using gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4),
on a 64 bit Linux system.
In the 'INSERT INTO' construct: I think that psql should first check that
the fields listed after the table name are valid, before checking that the
number of columns specified is sufficient for the number of expressions.
Due to my poor eyesight: it took me a few minutes before I realized that I
had used a fullstop '.' rather than a comma ',' in the list of columns.
There is neither a schema, nor a database, called 'id' - so I would have
thought that pg should have been able to detect the error.
DROP TABLE wage;
CREATE TABLE wage
id int PRIMARY KEY,
INSERT INTO wage (id. pay)
VALUES (1, 4.2);
$ psql < bug.sql
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "wage_pkey"
for table "wage"
ERROR: INSERT has more expressions than target columns
LINE 2: VALUES (1, 4.2);
id | pay
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2011-07-08 01:00:56|
|Subject: Re: BUG #6095: Misleading error message: INSERT has more expressions than target columns |
|Previous:||From: kmx||Date: 2011-07-07 23:51:16|
|Subject: PostgreSQL fails to build with 32bit MinGW-w64|