diff options
| author | Simon Riggs | 2017-09-06 20:46:01 +0000 |
|---|---|---|
| committer | Simon Riggs | 2017-09-06 20:46:01 +0000 |
| commit | 5b6d13eec72b960eb0f78542199380e49c8583d4 (patch) | |
| tree | 8893caeb77015bb2502f3795954b6f59b5b04305 /src/include | |
| parent | e09db94c0a5f3b440d96c5c9e8e6c1638d1ec39f (diff) | |
Allow SET STATISTICS on expression indexes
Index columns are referenced by ordinal number rather than name, e.g.
CREATE INDEX coord_idx ON measured (x, y, (z + t));
ALTER INDEX coord_idx ALTER COLUMN 3 SET STATISTICS 1000;
Incompatibility note for release notes:
\d+ for indexes now also displays Stats Target
Authors: Alexander Korotkov, with contribution by Adrien NAYRAT
Review: Adrien NAYRAT, Simon Riggs
Wordsmith: Simon Riggs
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/parsenodes.h | 2 | ||||
| -rw-r--r-- | src/include/utils/syscache.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index ef6753e31ad..3171815320c 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1777,6 +1777,8 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */ AlterTableType subtype; /* Type of table alteration to apply */ char *name; /* column, constraint, or trigger to act on, * or tablespace */ + int16 num; /* attribute number for columns referenced + * by number */ RoleSpec *newowner; Node *def; /* definition of new column, index, * constraint, or parent table */ diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h index 8352b40f4e2..8a92ea27acd 100644 --- a/src/include/utils/syscache.h +++ b/src/include/utils/syscache.h @@ -131,6 +131,9 @@ extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname); extern HeapTuple SearchSysCacheCopyAttName(Oid relid, const char *attname); extern bool SearchSysCacheExistsAttName(Oid relid, const char *attname); +extern HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum); +extern HeapTuple SearchSysCacheCopyAttNum(Oid relid, int16 attnum); + extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull); |
