postgresql/src/include
Tom Lane c4d3cd3dc8 Fix array slicing of int2vector and oidvector values.
The previous coding labeled expressions such as pg_index.indkey[1:3] as
being of int2vector type; which is not right because the subscript bounds
of such a result don't, in general, satisfy the restrictions of int2vector.
To fix, implicitly promote the result of slicing int2vector to int2[],
or oidvector to oid[].  This is similar to what we've done with domains
over arrays, which is a good analogy because these types are very much
like restricted domains of the corresponding regular-array types.

A side-effect is that we now also forbid array-element updates on such
columns, eg while "update pg_index set indkey[4] = 42" would have worked
before if you were superuser (and corrupted your catalogs irretrievably,
no doubt) it's now disallowed.  This seems like a good thing since, again,
some choices of subscripting would've led to results not satisfying the
restrictions of int2vector.  The case of an array-slice update was
rejected before, though with a different error message than you get now.
We could make these cases work in future if we added a cast from int2[]
to int2vector (with a cast function checking the subscript restrictions)
but it seems unlikely that there's any value in that.

Per report from Ronan Dunklau.  Back-patch to all supported branches
because of the crash risks involved.
2013-11-23 20:04:00 -05:00
..
access Fix race condition in GIN posting tree page deletion. 2013-11-08 22:23:03 +02:00
bootstrap Update copyrights for 2013 2013-01-01 17:15:01 -05:00
catalog Fix array slicing of int2vector and oidvector values. 2013-11-23 20:04:00 -05:00
commands Rename various "freeze multixact" variables 2013-09-16 15:56:11 -03:00
common pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
datatype Update copyrights for 2013 2013-01-01 17:15:01 -05:00
executor Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:45:47 -04:00
foreign Improve updatability checking for views and foreign tables. 2013-06-12 17:53:33 -04:00
lib Reset the binary heap in MergeAppend rescans. 2013-08-30 19:15:32 -04:00
libpq pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
mb pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
nodes Compute correct em_nullable_relids in get_eclass_for_sort_expr(). 2013-11-15 16:46:21 -05:00
optimizer Compute correct em_nullable_relids in get_eclass_for_sort_expr(). 2013-11-15 16:46:21 -05:00
parser Fix crash in error report of invalid tuple lock 2013-08-02 13:37:40 -04:00
port Unconditionally use the WSA equivalents of Socket error constants. 2013-08-26 14:58:14 -04:00
portability Update copyrights for 2013 2013-01-01 17:15:01 -05:00
postmaster Back-patch bgworker API changes to 9.3. 2013-07-22 15:41:44 -04:00
regex Support indexing of regular-expression searches in contrib/pg_trgm. 2013-04-09 01:06:54 -04:00
replication pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
rewrite Improve updatability checking for views and foreign tables. 2013-06-12 17:53:33 -04:00
snowball Update copyrights for 2013 2013-01-01 17:15:01 -05:00
storage Eliminate xmin from hash tag for predicate locks on heap tuples. 2013-10-07 14:26:54 -05:00
tcop pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
tsearch Update copyrights for 2013 2013-01-01 17:15:01 -05:00
utils Emit a log message if output is about to be redirected away from stderr. 2013-08-13 15:24:56 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
fmgr.h Add infrastructure for storing a VARIADIC ANY function's VARIADIC flag. 2013-01-21 20:26:15 -05:00
funcapi.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
getaddrinfo.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
getopt_long.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile Install headers from the new src/include/common subdirectory. 2013-02-26 15:27:30 -05:00
miscadmin.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pg_config.h.in Improve handling of ereport(ERROR) and elog(ERROR). 2013-01-13 18:40:09 -05:00
pg_config.h.win32 Stamp 9.3.1. 2013-10-07 23:17:38 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pg_trace.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pgstat.h Split pgstat file in smaller pieces 2013-02-18 18:12:52 -03:00
pgtar.h Move tar function headers to pgtar.h 2013-01-02 20:34:08 +01:00
pgtime.h Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:23 -04:00
port.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
postgres.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
postgres_ext.h Provide database object names as separate fields in error messages. 2013-01-29 17:08:26 -05:00
postgres_fe.h Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
rusagestub.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
windowapi.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00