aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-10-16 09:44:43 -0700
committerAndres Freund <andres@anarazel.de>2018-10-16 09:44:43 -0700
commit02a30a09f9e57a29f7bda82f5f4bfc214eed3980 (patch)
tree7e47acc68b2ddfcc4d45dbd723f5ea9b31c3e0d5 /src/backend/executor
parentc015ccb306ec81bca3023818c9cf0113cae25be1 (diff)
downloadpostgresql-02a30a09f9e57a29f7bda82f5f4bfc214eed3980.tar.gz
postgresql-02a30a09f9e57a29f7bda82f5f4bfc214eed3980.zip
Correct constness of system attributes in heap.c & prerequisites.
This allows the compiler / linker to mark affected pages as read-only. There's a fair number of pre-requisite changes, to allow the const properly be propagated. Most of consts were already required for correctness anyway, just not represented on the type-level. Arguably we could be more aggressive in using consts in related code, but.. This requires using a few of the types underlying typedefs that removes pointers (e.g. const NameData *) as declaring the typedefed type constant doesn't have the same meaning (it makes the variable const, not what it points to). Discussion: https://postgr.es/m/20181015200754.7y7zfuzsoux2c4ya@alap3.anarazel.de
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index fb36e762f28..19212738568 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -899,7 +899,7 @@ int
SPI_fnumber(TupleDesc tupdesc, const char *fname)
{
int res;
- Form_pg_attribute sysatt;
+ const FormData_pg_attribute *sysatt;
for (res = 0; res < tupdesc->natts; res++)
{
@@ -921,7 +921,7 @@ SPI_fnumber(TupleDesc tupdesc, const char *fname)
char *
SPI_fname(TupleDesc tupdesc, int fnumber)
{
- Form_pg_attribute att;
+ const FormData_pg_attribute *att;
SPI_result = 0;