diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-04 04:16:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-04 04:16:17 +0000 |
commit | dd8ad6411846f8ca609a824f3b515260be1f0ca1 (patch) | |
tree | f538d86b9b91cb91534ab6085878b03cbe914869 /src/backend/commands/command.c | |
parent | ed9ca687582caa88f31c4b273b9fd4eb5743cf41 (diff) | |
download | postgresql-dd8ad6411846f8ca609a824f3b515260be1f0ca1.tar.gz postgresql-dd8ad6411846f8ca609a824f3b515260be1f0ca1.zip |
Fix tuptoaster bugs induced by making bytea toastable. Durn thing was
trying to toast tuples inserted into toast tables! Fix is two-pronged:
first, ensure all columns of a toast table are marked attstorage='p',
and second, alter the target chunk size so that it's less than the
threshold for trying to toast a tuple. (Code tried to do that but the
expression was wrong.) A few cosmetic cleanups in tuptoaster too.
NOTE: initdb forced due to change in toaster chunk-size.
Diffstat (limited to 'src/backend/commands/command.c')
-rw-r--r-- | src/backend/commands/command.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index de2597bd266..68487f64ffc 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.93 2000/08/03 19:19:18 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.94 2000/08/04 04:16:06 tgl Exp $ * * NOTES * The PerformAddAttribute() code, like most of the relation @@ -1503,6 +1503,14 @@ AlterTableCreateToastTable(const char *relationName, bool silent) "chunk_data", BYTEAOID, -1, 0, false); + /* + * Ensure that the toast table doesn't itself get toasted, + * or we'll be toast :-(. This is essential for chunk_data because + * type bytea is toastable; hit the other two just to be sure. + */ + tupdesc->attrs[0]->attstorage = 'p'; + tupdesc->attrs[1]->attstorage = 'p'; + tupdesc->attrs[2]->attstorage = 'p'; /* * Note: the toast relation is considered a "normal" relation even if |