postgresql/src/include
Tom Lane 45e02e3232 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:03:56 -05:00
..
access Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05: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:03:56 -05:00
commands Allow aggregates to provide estimates of their transition state data size. 2013-11-16 16:03:40 -05:00
common Replace pg_asprintf() with psprintf(). 2013-10-22 19:40:26 -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:46:14 -04:00
foreign Improve updatability checking for views and foreign tables. 2013-06-12 17:53:33 -04:00
lib Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
libpq Add large object functions catering to SQL callers. 2013-10-27 22:56:54 -04:00
mb Renovate display of non-ASCII messages on Windows. 2013-06-26 11:17:33 -04:00
nodes Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
optimizer Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
parser Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
port Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
portability Allow dynamic allocation of shared memory segments. 2013-10-09 21:05:02 -04:00
postmaster Provide a reliable mechanism for terminating a background worker. 2013-10-18 10:23:11 -04:00
regex Fix old typo in comment. 2013-10-29 15:34:18 -04:00
replication pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
rewrite Allow only some columns of a view to be auto-updateable. 2013-10-18 10:35:36 -04:00
snowball Update copyrights for 2013 2013-01-01 17:15:01 -05:00
storage Modify dynamic shared memory code to use Size rather than uint64. 2013-10-28 12:12:06 -04: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 Add make_date() and make_time() functions. 2013-11-17 15:06:50 -05: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 Consistently use unsigned arithmetic for alignment calculations. 2013-10-20 21:04:52 -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 Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
miscadmin.h Remove CTimeZone/HasCTZSet, root and branch. 2013-11-01 13:57:31 -04:00
pg_config.h.in Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
pg_config.h.win32 Revert WAL posix_fallocate() patches. 2013-09-04 23:43:41 -07: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 Keep heavily-contended fields in XLogCtlInsert on different cache lines. 2013-09-04 23:14:33 +03: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:18 -04:00
port.h Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
postgres.h Add comment for VARSIZE_ANY_EXHDR macro 2013-09-10 20:18:53 -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