aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap/bootstrap.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-03-25 03:49:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-03-25 03:49:34 +0000
commit6febecc569f42817b7b86a167a38e682317a6c2c (patch)
tree7dddca9d4e5e9ddde660f11042738a007b591eee /src/backend/bootstrap/bootstrap.c
parentd471f8073a51a7769efad581e017e7c0fd5e9e84 (diff)
downloadpostgresql-6febecc569f42817b7b86a167a38e682317a6c2c.tar.gz
postgresql-6febecc569f42817b7b86a167a38e682317a6c2c.zip
Clean up att_align calculations so that XXXALIGN macros
need not be bogus.
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r--src/backend/bootstrap/bootstrap.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index eacb0129f6b..c4cb0df1c56 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.56 1999/03/17 22:52:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.57 1999/03/25 03:49:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -605,8 +605,28 @@ DefineAttr(char *name, char *type, int attnum)
printf("<%s %s> ", attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Procid[typeoid].len;
- attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4);
- attrtypes[attnum]->attalign = 'i';
+ /* Cheat like mad to fill in these items from the length only.
+ * This only has to work for types used in the system catalogs...
+ */
+ switch (attlen)
+ {
+ case 1:
+ attrtypes[attnum]->attbyval = true;
+ attrtypes[attnum]->attalign = 'c';
+ break;
+ case 2:
+ attrtypes[attnum]->attbyval = true;
+ attrtypes[attnum]->attalign = 's';
+ break;
+ case 4:
+ attrtypes[attnum]->attbyval = true;
+ attrtypes[attnum]->attalign = 'i';
+ break;
+ default:
+ attrtypes[attnum]->attbyval = false;
+ attrtypes[attnum]->attalign = 'i';
+ break;
+ }
}
attrtypes[attnum]->attcacheoff = -1;
attrtypes[attnum]->atttypmod = -1;