postgresql/src/backend
Tom Lane 6d30fb1f75 Make SPI_fnumber() reject dropped columns.
There's basically no scenario where it's sensible for this to match
dropped columns, so put a test for dropped-ness into SPI_fnumber()
itself, and excise the test from the small number of callers that
were paying attention to the case.  (Most weren't :-(.)

In passing, normalize tests at call sites: always reject attnum <= 0
if we're disallowing system columns.  Previously there was a mixture
of "< 0" and "<= 0" tests.  This makes no practical difference since
SPI_fnumber() never returns 0, but I'm feeling pedantic today.

Also, in the places that are actually live user-facing code and not
legacy cruft, distinguish "column not found" from "can't handle
system column".

Per discussion with Jim Nasby; thi supersedes his original patch
that just changed the behavior at one call site.

Discussion: <b2de8258-c4c0-1cb8-7b97-e8538e5c975c@BlueTreble.com>
2016-11-08 13:11:26 -05:00
..
access Improve handling of dead tuples in hash indexes. 2016-11-08 10:52:51 -05:00
bootstrap Fix a bunch of places that called malloc and friends with no NULL check. 2016-08-30 18:22:43 -04:00
catalog Fix another bug in merging of inherited CHECK constraints. 2016-10-13 17:05:14 -04:00
commands Implement syntax for transition tables in AFTER triggers. 2016-11-04 10:49:50 -05:00
executor Make SPI_fnumber() reject dropped columns. 2016-11-08 13:11:26 -05:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Clarify the new Red-Black post-order traversal code a bit. 2016-09-04 15:02:06 +03:00
libpq Consistently mention 'SELECT pg_reload_conf()' in config files 2016-10-25 11:26:15 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Implement syntax for transition tables in AFTER triggers. 2016-11-04 10:49:50 -05:00
optimizer Adjust cost_merge_append() to reflect use of binaryheap_replace_first(). 2016-11-05 13:48:11 -04:00
parser Implement syntax for transition tables in AFTER triggers. 2016-11-04 10:49:50 -05:00
po Translation updates 2016-08-08 11:08:00 -04:00
port Try to find out the actual hugepage size when making a MAP_HUGETLB request. 2016-10-13 15:06:46 -04:00
postmaster If the stats collector dies during Hot Standby, restart it. 2016-10-27 14:27:40 -04:00
regex Make locale-dependent regex character classes work for large char codes. 2016-09-05 17:06:29 -04:00
replication Fix typos in comments. 2016-10-26 11:12:31 +03:00
rewrite Improve parser's and planner's handling of set-returning functions. 2016-09-13 13:54:24 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Add API to check if an existing exclusive lock allows cleanup. 2016-11-04 09:32:24 -04:00
tcop Make getrusage() output a little more readable 2016-10-19 09:53:16 -04:00
tsearch Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
utils Make SPI_fnumber() reject dropped columns. 2016-11-08 13:11:26 -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 Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00