aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-10-27 11:25:20 +0100
committerPeter Eisentraut <peter_e@gmx.net>2018-11-01 20:35:42 +0100
commitfe5038236c6b99d48c2faa2247b5cec9703add2a (patch)
treea2c6f1e82dcac5f0e2ab9c654aa7f29983ffa822 /src
parent8a99f8a82775cee3fd35abb21a29b5b2dfc31cf5 (diff)
downloadpostgresql-fe5038236c6b99d48c2faa2247b5cec9703add2a.tar.gz
postgresql-fe5038236c6b99d48c2faa2247b5cec9703add2a.zip
Remove obsolete pg_attrdef.adsrc column
This has been deprecated and effectively unused for a long time. Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/heap.c12
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_attrdef.h1
3 files changed, 1 insertions, 14 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 3c9c03c9971..640e283688b 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -2152,7 +2152,6 @@ StoreAttrDefault(Relation rel, AttrNumber attnum,
Node *expr, bool is_internal, bool add_column_mode)
{
char *adbin;
- char *adsrc;
Relation adrel;
HeapTuple tuple;
Datum values[4];
@@ -2170,20 +2169,11 @@ StoreAttrDefault(Relation rel, AttrNumber attnum,
adbin = nodeToString(expr);
/*
- * Also deparse it to form the mostly-obsolete adsrc field.
- */
- adsrc = deparse_expression(expr,
- deparse_context_for(RelationGetRelationName(rel),
- RelationGetRelid(rel)),
- false, false);
-
- /*
* Make the pg_attrdef entry.
*/
values[Anum_pg_attrdef_adrelid - 1] = RelationGetRelid(rel);
values[Anum_pg_attrdef_adnum - 1] = attnum;
values[Anum_pg_attrdef_adbin - 1] = CStringGetTextDatum(adbin);
- values[Anum_pg_attrdef_adsrc - 1] = CStringGetTextDatum(adsrc);
adrel = heap_open(AttrDefaultRelationId, RowExclusiveLock);
@@ -2198,10 +2188,8 @@ StoreAttrDefault(Relation rel, AttrNumber attnum,
/* now can free some of the stuff allocated above */
pfree(DatumGetPointer(values[Anum_pg_attrdef_adbin - 1]));
- pfree(DatumGetPointer(values[Anum_pg_attrdef_adsrc - 1]));
heap_freetuple(tuple);
pfree(adbin);
- pfree(adsrc);
/*
* Update the pg_attribute entry for the column to show that a default
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index f2e9d5dc1f0..8e92b287cc2 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201810301
+#define CATALOG_VERSION_NO 201811011
#endif
diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h
index e4a37ec3268..a9a2351efdd 100644
--- a/src/include/catalog/pg_attrdef.h
+++ b/src/include/catalog/pg_attrdef.h
@@ -33,7 +33,6 @@ CATALOG(pg_attrdef,2604,AttrDefaultRelationId)
#ifdef CATALOG_VARLEN /* variable-length fields start here */
pg_node_tree adbin BKI_FORCE_NOT_NULL; /* nodeToString representation of default */
- text adsrc BKI_FORCE_NOT_NULL; /* human-readable representation of default */
#endif
} FormData_pg_attrdef;