Oops, forgot we had a macro to encapsulate test for type toastability.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 22 Apr 2002 21:56:06 +0000 (21:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 22 Apr 2002 21:56:06 +0000 (21:56 +0000)
src/backend/commands/tablecmds.c

index 4bff692e2d8290deced0bfadebf05a5c36c5f794..2d0b1a801606d22ad4c577e11a3e30e0e51fec8b 100644 (file)
@@ -888,10 +888,9 @@ AlterTableAlterColumnFlags(Oid myrelid,
        {
                /*
                 * safety check: do not allow toasted storage modes unless column
-                * datatype is TOAST-aware.  We assume the datatype's typstorage
-                * will be 'p' if and only if it ain't TOAST-aware.
+                * datatype is TOAST-aware.
                 */
-               if (newstorage == 'p' || get_typstorage(attrtuple->atttypid) != 'p')
+               if (newstorage == 'p' || TypeIsToastable(attrtuple->atttypid))
                        attrtuple->attstorage = newstorage;
                else
                        elog(ERROR, "ALTER TABLE: Column datatype %s can only have storage \"plain\"",