ERROR: attribute number 6 exceeds number of columns 5
Andreas Joseph Krogh <andreas@visena.com>
From: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-11-26T14:04:51Z
Lists: pgsql-hackers
Attachments
- error.sql (application/sql)
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 Splitting up the alter-table like this makes it work: alter table access add column start_timestamp timestamp not null DEFAULT CURRENT_TIMESTAMP, add column end_timestamp timestamp ; alter table access add column tsrange TSRANGE NOT NULL GENERATED ALWAYS AS (tsrange(start_timestamp, end_timestamp, '[)')) STORED ; -- Andreas Joseph Krogh
Commits
-
Fix handling of generated columns in ALTER TABLE.
- c24f3b70efc2 12.2 landed
- 4ac8aaa36fa2 13.0 landed