Skip to content

Commit cc332d6

Browse files
committed
AttrConstr --> TupleConstr
1 parent e482462 commit cc332d6

File tree

4 files changed

+36
-21
lines changed

4 files changed

+36
-21
lines changed

src/backend/access/common/tupdesc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.16 1997/08/21 03:01:15 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.17 1997/08/21 04:03:34 vadim Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -119,8 +119,8 @@ CreateTupleDescCopy(TupleDesc tupdesc)
119119
ATTRIBUTE_TUPLE_SIZE);
120120
}
121121
if (tupdesc->constr) {
122-
desc->constr = (AttrConstr *) palloc(sizeof(struct attrConstr));
123-
memmove(desc->constr, tupdesc->constr, sizeof(struct attrConstr));
122+
desc->constr = (TupleConstr *) palloc(sizeof(TupleConstr));
123+
memmove(desc->constr, tupdesc->constr, sizeof(TupleConstr));
124124
} else
125125
desc->constr = NULL;
126126
return desc;
@@ -179,7 +179,7 @@ TupleDescInitEntry(TupleDesc desc,
179179
memset(att->attname.data,0,NAMEDATALEN);
180180

181181

182-
att->attdisbursion = 0; /* dummy value */
182+
att->attnvals = 0; /* dummy value */
183183
att->attcacheoff = -1;
184184

185185
att->attnum = attributeNumber;
@@ -387,7 +387,7 @@ BuildDescForRelation(List *schema, char *relname)
387387
/* This is for constraints */
388388
if (entry->is_not_null) {
389389
if (!desc->constr)
390-
desc->constr = (AttrConstr *) palloc(sizeof(struct attrConstr));
390+
desc->constr = (TupleConstr *) palloc(sizeof(TupleConstr));
391391
desc->constr->has_not_null = true;
392392
}
393393
desc->attrs[attnum-1]->attnotnull = entry->is_not_null;

src/backend/commands/creatinh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.12 1997/08/19 04:43:30 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.13 1997/08/21 04:05:22 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -276,7 +276,7 @@ MergeAttributes(List *schema, List *supers)
276276
AttributeTupleForm attribute = tupleDesc->attrs[attrno];
277277
char *attributeName;
278278
char *attributeType;
279-
AttrConstr constraints;
279+
TupleConstr constraints;
280280
HeapTuple tuple;
281281
ColumnDef *def;
282282
TypeName *typename;

src/backend/utils/cache/relcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.17 1997/08/21 01:36:09 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.18 1997/08/21 04:09:51 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -500,7 +500,7 @@ RelationBuildTupleDesc(RelationBuildDescInfo buildinfo,
500500
build_tupdesc_seq(buildinfo, relation, natts);
501501
else
502502
{
503-
relation->rd_att->constr = (AttrConstr *) palloc(sizeof(struct attrConstr));
503+
relation->rd_att->constr = (TupleConstr *) palloc(sizeof(TupleConstr));
504504
relation->rd_att->constr->num_check = 0;
505505
relation->rd_att->constr->num_defval = 0;
506506
relation->rd_att->constr->has_not_null = false;

src/include/access/tupdesc.h

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: tupdesc.h,v 1.6 1997/08/19 04:45:20 vadim Exp $
9+
* $Id: tupdesc.h,v 1.7 1997/08/21 04:10:25 vadim Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -17,23 +17,38 @@
1717
#include <access/attnum.h>
1818
#include <catalog/pg_attribute.h>
1919

20-
typedef struct attrConstr {
21-
/*------------------------------------------------------------------------
22-
This structure contains flags to the constraints of a tuple
23-
------------------------------------------------------------------------*/
24-
bool has_not_null;
25-
} AttrConstr;
2620

21+
typedef struct attrDefault {
22+
AttrNumber adnum;
23+
char *adbin;
24+
char *adsrc;
25+
} AttrDefault;
26+
27+
typedef struct constrCheck {
28+
char *ccname;
29+
char *ccbin;
30+
char *ccsrc;
31+
} ConstrCheck;
32+
33+
/* This structure contains constraints of a tuple */
34+
typedef struct tupleConstr {
35+
AttrDefault *defval;
36+
ConstrCheck *check;
37+
uint16 num_defval;
38+
uint16 num_check;
39+
bool has_not_null;
40+
} TupleConstr;
41+
42+
/*
43+
* This structure contains all information (i.e. from Classes
44+
* pg_attribute, pg_attrdef, pg_relcheck) for a tuple.
45+
*/
2746
typedef struct tupleDesc {
28-
/*------------------------------------------------------------------------
29-
This structure contains all the attribute information (i.e. from Class
30-
pg_attribute) for a tuple.
31-
-------------------------------------------------------------------------*/
3247
int natts;
3348
/* Number of attributes in the tuple */
3449
AttributeTupleForm *attrs;
3550
/* attrs[N] is a pointer to the description of Attribute Number N+1. */
36-
AttrConstr *constr;
51+
TupleConstr *constr;
3752
} *TupleDesc;
3853

3954
extern TupleDesc CreateTemplateTupleDesc(int natts);

0 commit comments

Comments
 (0)