summaryrefslogtreecommitdiff
path: root/src/include/utils/typcache.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-03-06 12:19:29 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-03-06 12:19:29 -0500
commitfe30e7ebfa3846416f1adeb7cf611006513a4ee0 (patch)
tree9595f013d6fee593182b0f098fbf55dd7562341e /src/include/utils/typcache.h
parentaddd034ae1795d0a99305b294e4dce44c6b1dfd8 (diff)
downloadpostgresql-fe30e7ebfa3846416f1adeb7cf611006513a4ee0.tar.gz
Allow ALTER TYPE to change some properties of a base type.
Specifically, this patch allows ALTER TYPE to: * Change the default TOAST strategy for a toastable base type; * Promote a non-toastable type to toastable; * Add/remove binary I/O functions for a type; * Add/remove typmod I/O functions for a type; * Add/remove a custom ANALYZE statistics functions for a type. The first of these can be done by the type's owner; all the others require superuser privilege since misuse could cause problems. The main motivation for this patch is to allow extensions to upgrade the feature sets of their data types, so the set of alterable properties is biased towards that use-case. However it's also true that changing some other properties would be a lot harder, as they get baked into physical storage and/or stored expressions that depend on the type. Along the way, refactor GenerateTypeDependencies() to make it easier to call, refactor DefineType's volatility checks so they can be shared by AlterType, and teach typcache.c that it might have to reload data from the type's pg_type row, a scenario it never handled before. Also rearrange alter_type.sgml a bit for clarity (put the composite-type operations together). Tomas Vondra and Tom Lane Discussion: https://postgr.es/m/20200228004440.b23ein4qvmxnlpht@development
Diffstat (limited to 'src/include/utils/typcache.h')
-rw-r--r--src/include/utils/typcache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/utils/typcache.h b/src/include/utils/typcache.h
index 66ff17dbd5..cdd20e56d7 100644
--- a/src/include/utils/typcache.h
+++ b/src/include/utils/typcache.h
@@ -33,6 +33,8 @@ typedef struct TypeCacheEntry
/* typeId is the hash lookup key and MUST BE FIRST */
Oid type_id; /* OID of the data type */
+ uint32 type_id_hash; /* hashed value of the OID */
+
/* some subsidiary information copied from the pg_type row */
int16 typlen;
bool typbyval;