Re: ERROR: attribute number 6 exceeds number of columns 5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: ERROR: attribute number 6 exceeds number of columns 5
Date: 2019-11-26 15:49:11
Message-ID: 6352.1574783351@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andreas Joseph Krogh <andreas(at)visena(dot)com> writes:
> Run the attached script and you'll get:

> psql -f error.sql -d test
> psql:error.sql:37: ERROR: attribute number 6 exceeds number of columns 5

Hmm, interesting. IMO, that *should* have thrown an error, but of
course not that one. The ADD COLUMN operations are all processed
in parallel, so it's not okay for one of them to have a GENERATED
expression that refers to another one of the new columns. But you
should have gotten a "no such column" type of error, not a run-time
cross-check failure.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2019-11-26 16:31:41 Re: Copyright information in source files
Previous Message Tom Lane 2019-11-26 15:32:29 Re: benchmarking Flex practices