postgresql/src/backend
Alvaro Herrera 4e563a1f65 Fix ALTER TABLE / SET TYPE for irregular inheritance
If inherited tables don't have exactly the same schema, the USING clause
in an ALTER TABLE / SET DATA TYPE misbehaves when applied to the
children tables since commit 9550e8348b.  Starting with that commit,
the attribute numbers in the USING expression are fixed during parse
analysis.  This can lead to bogus errors being reported during
execution, such as:
   ERROR:  attribute 2 has wrong type
   DETAIL:  Table has type smallint, but query expects integer.

Since it wouldn't do to revert to the original coding, we now apply a
transformation to map the attribute numbers to the correct ones for each
child.

Reported by Justin Pryzby
Analysis by Tom Lane; patch by me.
Discussion: https://postgr.es/m/20170102225618.GA10071@telsasoft.com
2017-01-09 19:26:58 -03:00
..
access Fix ALTER TABLE / SET TYPE for irregular inheritance 2017-01-09 19:26:58 -03:00
bootstrap Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
catalog Log the creation of an init fork unconditionally. 2016-12-08 14:13:55 -05:00
commands Fix ALTER TABLE / SET TYPE for irregular inheritance 2017-01-09 19:26:58 -03:00
executor Fix handling of expanded objects in CoerceToDomain and CASE execution. 2016-12-22 15:01:38 -05:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:46:03 -03:00
libpq Include <sys/select.h> where needed 2016-09-27 01:05:21 -03:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Fix improper repetition of previous results from a hashed aggregate. 2016-08-24 14:38:13 -04:00
optimizer Fix FK-based join selectivity estimation for semi/antijoins. 2016-12-17 15:28:54 -05:00
parser Fix CREATE TABLE ... LIKE ... WITH OIDS. 2016-12-22 16:23:34 -05:00
po Translation updates 2016-10-24 11:15:25 -04:00
port Try to find out the actual hugepage size when making a MAP_HUGETLB request. 2016-10-13 15:06:57 -04:00
postmaster If the stats collector dies during Hot Standby, restart it. 2016-10-27 14:54:35 -04:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:12:16 -05:00
replication Fix base backup rate limiting in presence of slow i/o 2016-12-19 10:15:52 +01:00
rewrite pgindent run for 9.6 2016-06-09 18:02:36 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Fix possible leak of semaphore count. 2017-01-05 14:33:29 -05:00
tcop Use TSConfigRelationId in AlterTSConfiguration() 2016-12-22 17:08:47 -05:00
tsearch Improve documentation around TS_execute(). 2016-12-16 11:50:18 -05:00
utils Invalidate cached plans on FDW option changes. 2017-01-06 14:12:52 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00