|
7 | 7 | * |
8 | 8 | * Copyright (c) 1994, Regents of the University of California |
9 | 9 | * |
10 | | - * $Id: pg_attribute.h,v 1.1.1.1 1996/07/09 06:21:16 scrappy Exp $ |
| 10 | + * $Id: pg_attribute.h,v 1.2 1996/08/21 04:25:47 scrappy Exp $ |
11 | 11 | * |
12 | 12 | * NOTES |
13 | 13 | * the genbki.sh script reads this file and generates .bki |
|
18 | 18 | * these changes, be sure and change the appropriate Schema_xxx |
19 | 19 | * macros! -cim 2/5/91 |
20 | 20 | * |
21 | | - * fastgetattr() now uses attcacheoff to cache byte offsets of |
22 | | - * attributes in heap tuples. The data actually stored in |
23 | | - * pg_attribute (-1) indicates no cached value. But when we copy |
24 | | - * these tuples into a tuple descriptor, we may then update attcacheoff |
25 | | - * in the copies. This speeds up the attribute walking process. |
26 | | - * |
27 | 21 | *------------------------------------------------------------------------- |
28 | 22 | */ |
29 | 23 | #ifndefPG_ATTRIBUTE_H |
@@ -54,15 +48,39 @@ CATALOG(pg_attribute) BOOTSTRAP { |
54 | 48 | int4attnvals; |
55 | 49 | Oidatttyparg;/* type arg for arrays/spquel/procs */ |
56 | 50 | int2attlen; |
| 51 | +/* attlen is the number of bytes we use to represent the value |
| 52 | + of this attribute, e.g. 4 for an int4. But for a variable length |
| 53 | + attribute, attlen is -1. |
| 54 | + */ |
57 | 55 | int2attnum; |
| 56 | +/* attnum is the "attribute number" for the attribute: A |
| 57 | + value that uniquely identifies this attribute within its class. |
| 58 | + For user attributes, Attribute numbers are greater than 0 and |
| 59 | + not greater than the number of attributes in the class. |
| 60 | + I.e. if the Class pg_class says that Class XYZ has 10 |
| 61 | + attributes, then the user attribute numbers in Class |
| 62 | + pg_attribute must be 1-10. |
| 63 | +
|
| 64 | + System attributes have attribute numbers less than 0 that are |
| 65 | + unique within the class, but not constrained to any particular range. |
| 66 | +
|
| 67 | + Note that (attnum - 1) is often used as the index to an array. |
| 68 | + */ |
58 | 69 | int2attbound; |
59 | 70 | boolattbyval; |
60 | 71 | boolattcanindex; |
61 | 72 | Oidattproc;/* spquel? */ |
62 | 73 | int4attnelems; |
63 | 74 | int4attcacheoff; |
| 75 | +/* fastgetattr() uses attcacheoff to cache byte offsets of |
| 76 | + attributes in heap tuples. The data actually stored in |
| 77 | + pg_attribute (-1) indicates no cached value. But when we |
| 78 | + copy these tuples into a tuple descriptor, we may then update |
| 79 | + attcacheoff in the copies. This speeds up the attribute |
| 80 | + walking process. |
| 81 | + */ |
64 | 82 | boolattisset; |
65 | | -charattalign;/* alignment (c=char, s=short, i=int, d=double) */ |
| 83 | +charattalign;/* alignment (c=char, s=short, i=int, d=double) */ |
66 | 84 | }FormData_pg_attribute; |
67 | 85 |
|
68 | 86 | /* |
@@ -380,43 +398,43 @@ DATA(insert OID = 0 ( 75 vtype 18 0 0 0 1 -11 0 t t 0 0 -1 f c)); |
380 | 398 | * ---------------- |
381 | 399 | */ |
382 | 400 | #defineSchema_pg_class \ |
383 | | -{ 83l, {"relname"}, 19l, 83l, 0l, 0l, NAMEDATALEN, 1, 0, '\0', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
384 | | -{ 83l, {"reltype"}, 26l, 83l, 0l, 0l, 4, 2, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
385 | | -{ 83l, {"relowner"}, 26l, 83l, 0l, 0l, 4,2, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
386 | | -{ 83l, {"relam"}, 26l, 83l, 0l, 0l, 4,3, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
387 | | -{ 83l, {"relpages"}, 23, 83l, 0l, 0l, 4,4, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
388 | | -{ 83l, {"reltuples"}, 23, 83l, 0l, 0l, 4,5, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
389 | | -{ 83l, {"relexpires"}, 702, 83l, 0l, 0l, 4,6, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
390 | | -{ 83l, {"relpreserved"}, 703, 83l, 0l, 0l, 4,7, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
391 | | -{ 83l, {"relhasindex"}, 16, 83l, 0l, 0l, 1,8, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
392 | | -{ 83l, {"relisshared"}, 16, 83l, 0l, 0l, 1, 9, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
393 | | -{ 83l, {"relkind"}, 18, 83l, 0l, 0l, 1,10, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
394 | | -{ 83l, {"relarch"}, 18, 83l, 0l, 0l, 1,11, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
395 | | -{ 83l, {"relnatts"}, 21, 83l, 0l, 0l, 2,12, 0, '\001', '\001', 0l, 0l, -1l, '\0', 's' }, \ |
396 | | -{ 83l, {"relsmgr"}, 210l,83l, 0l, 0l, 2,13, 0, '\001', '\001', 0l, 0l, -1l, '\0', 's' }, \ |
397 | | -{ 83l, {"relkey"}, 22, 83l, 0l, 0l, 16,14, 0, '\0', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
398 | | -{ 83l, {"relkeyop"}, 30, 83l, 0l, 0l, 32,15, 0, '\0', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
399 | | -{ 83l, {"relhasrules"}, 16, 83l, 0l, 0l, 1,16, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
400 | | -{ 83l, {"relacl"}, 1034l, 83l, 0l, 0l, -1,17, 0, '\0', '\001', 0l, 0l, -1l, '\0', 'i' } |
| 401 | +{ 83l, {"relname"}, 19l,83l, 0l, 0l, NAMEDATALEN, 1, 0, '\000', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 402 | +{ 83l, {"reltype"},26l, 83l, 0l, 0l, 4, 2, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 403 | +{ 83l, {"relowner"}, 26l,83l, 0l, 0l, 4,3, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 404 | +{ 83l, {"relam"}, 26l,83l, 0l, 0l, 4,4, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 405 | +{ 83l, {"relpages"}, 23,83l, 0l, 0l, 4,5, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 406 | +{ 83l, {"reltuples"}, 23,83l, 0l, 0l, 4,6, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 407 | +{ 83l, {"relexpires"}, 702, 83l, 0l, 0l, 4,7, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 408 | +{ 83l, {"relpreserved"}, 703, 83l, 0l, 0l, 4,8, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 409 | +{ 83l, {"relhasindex"}, 16,83l, 0l, 0l, 1,9, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
| 410 | +{ 83l, {"relisshared"}, 16,83l, 0l, 0l, 1,10, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
| 411 | +{ 83l, {"relkind"}, 18,83l, 0l, 0l, 1,11, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
| 412 | +{ 83l, {"relarch"}, 18,83l, 0l, 0l, 1,12, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
| 413 | +{ 83l, {"relnatts"}, 21,83l, 0l, 0l, 2,13, 0, '\001', '\001', 0l, 0l, -1l, '\0', 's' }, \ |
| 414 | +{ 83l, {"relsmgr"}, 210l, 83l, 0l, 0l, 2,14, 0, '\001', '\001', 0l, 0l, -1l, '\0', 's' }, \ |
| 415 | +{ 83l, {"relkey"}, 22,83l, 0l, 0l, 16,15, 0,'\000', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 416 | +{ 83l, {"relkeyop"}, 30,83l, 0l, 0l, 32,16, 0,'\000', '\001', 0l, 0l, -1l, '\0', 'i' }, \ |
| 417 | +{ 83l, {"relhasrules"}, 16,83l, 0l, 0l, 1,17, 0, '\001', '\001', 0l, 0l, -1l, '\0', 'c' }, \ |
| 418 | +{ 83l, {"relacl"}, 1034l,83l, 0l, 0l, -1,18, 0,'\000', '\001', 0l, 0l, -1l, '\0', 'i' } |
401 | 419 |
|
402 | 420 | DATA(insertOID=0 (83relname19000NAMEDATALEN10ft00-1fi)); |
403 | 421 | DATA(insertOID=0 (83reltype26000420tt00-1fi)); |
404 | | -DATA(insertOID=0 (83relowner26000420tt00-1fi)); |
405 | | -DATA(insertOID=0 (83relam26000430tt00-1fi)); |
406 | | -DATA(insertOID=0 (83relpages23000440tt00-1fi)); |
407 | | -DATA(insertOID=0 (83reltuples23000450tt00-1fi)); |
408 | | -DATA(insertOID=0 (83relexpires702000460tt00-1fi)); |
409 | | -DATA(insertOID=0 (83relpreserved702000470tt00-1fi)); |
410 | | -DATA(insertOID=0 (83relhasindex16000180tt00-1fc)); |
411 | | -DATA(insertOID=0 (83relisshared16000190tt00-1fc)); |
412 | | -DATA(insertOID=0 (83relkind180001100tt00-1fc)); |
413 | | -DATA(insertOID=0 (83relarch180001110tt00-1fc)); |
414 | | -DATA(insertOID=0 (83relnatts210002120tt00-1fs)); |
415 | | -DATA(insertOID=0 (83relsmgr2100002130tt00-1fs)); |
416 | | -DATA(insertOID=0 (83relkey2200016140ft00-1fi)); |
417 | | -DATA(insertOID=0 (83relkeyop3000032150ft00-1fi)); |
418 | | -DATA(insertOID=0 (83relhasrules160001160tt00-1fc)); |
419 | | -DATA(insertOID=0 (83relacl1034000-1170ft00-1fi)); |
| 422 | +DATA(insertOID=0 (83relowner26000430tt00-1fi)); |
| 423 | +DATA(insertOID=0 (83relam26000440tt00-1fi)); |
| 424 | +DATA(insertOID=0 (83relpages23000450tt00-1fi)); |
| 425 | +DATA(insertOID=0 (83reltuples23000460tt00-1fi)); |
| 426 | +DATA(insertOID=0 (83relexpires702000470tt00-1fi)); |
| 427 | +DATA(insertOID=0 (83relpreserved703000480tt00-1fi)); |
| 428 | +DATA(insertOID=0 (83relhasindex16000190tt00-1fc)); |
| 429 | +DATA(insertOID=0 (83relisshared160001100tt00-1fc)); |
| 430 | +DATA(insertOID=0 (83relkind180001110tt00-1fc)); |
| 431 | +DATA(insertOID=0 (83relarch180001120tt00-1fc)); |
| 432 | +DATA(insertOID=0 (83relnatts210002130tt00-1fs)); |
| 433 | +DATA(insertOID=0 (83relsmgr2100002140tt00-1fs)); |
| 434 | +DATA(insertOID=0 (83relkey2200016150ft00-1fi)); |
| 435 | +DATA(insertOID=0 (83relkeyop3000032160ft00-1fi)); |
| 436 | +DATA(insertOID=0 (83relhasrules160001170tt00-1fc)); |
| 437 | +DATA(insertOID=0 (83relacl1034000-1180ft00-1fi)); |
420 | 438 | DATA(insertOID=0 (83ctid270006-10ft00-1fi)); |
421 | 439 | DATA(insertOID=0 (83oid260004-20tt00-1fi)); |
422 | 440 | DATA(insertOID=0 (83xmin280004-30ft00-1fi)); |
|