Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
cc332d61
Commit
cc332d61
authored
Aug 21, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AttrConstr --> TupleConstr
parent
e4824629
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
21 deletions
+36
-21
src/backend/access/common/tupdesc.c
src/backend/access/common/tupdesc.c
+5
-5
src/backend/commands/creatinh.c
src/backend/commands/creatinh.c
+2
-2
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+2
-2
src/include/access/tupdesc.h
src/include/access/tupdesc.h
+27
-12
No files found.
src/backend/access/common/tupdesc.c
View file @
cc332d61
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.1
6 1997/08/21 03:01:15 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.1
7 1997/08/21 04:03:34 vadim
Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
...
...
@@ -119,8 +119,8 @@ CreateTupleDescCopy(TupleDesc tupdesc)
ATTRIBUTE_TUPLE_SIZE
);
}
if
(
tupdesc
->
constr
)
{
desc
->
constr
=
(
AttrConstr
*
)
palloc
(
sizeof
(
struct
attr
Constr
));
memmove
(
desc
->
constr
,
tupdesc
->
constr
,
sizeof
(
struct
attr
Constr
));
desc
->
constr
=
(
TupleConstr
*
)
palloc
(
sizeof
(
Tuple
Constr
));
memmove
(
desc
->
constr
,
tupdesc
->
constr
,
sizeof
(
Tuple
Constr
));
}
else
desc
->
constr
=
NULL
;
return
desc
;
...
...
@@ -179,7 +179,7 @@ TupleDescInitEntry(TupleDesc desc,
memset
(
att
->
attname
.
data
,
0
,
NAMEDATALEN
);
att
->
att
disbursion
=
0
;
/* dummy value */
att
->
att
nvals
=
0
;
/* dummy value */
att
->
attcacheoff
=
-
1
;
att
->
attnum
=
attributeNumber
;
...
...
@@ -387,7 +387,7 @@ BuildDescForRelation(List *schema, char *relname)
/* This is for constraints */
if
(
entry
->
is_not_null
)
{
if
(
!
desc
->
constr
)
desc
->
constr
=
(
AttrConstr
*
)
palloc
(
sizeof
(
struct
attr
Constr
));
desc
->
constr
=
(
TupleConstr
*
)
palloc
(
sizeof
(
Tuple
Constr
));
desc
->
constr
->
has_not_null
=
true
;
}
desc
->
attrs
[
attnum
-
1
]
->
attnotnull
=
entry
->
is_not_null
;
...
...
src/backend/commands/creatinh.c
View file @
cc332d61
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.1
2 1997/08/19 04:43:30
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.1
3 1997/08/21 04:05:22
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -276,7 +276,7 @@ MergeAttributes(List *schema, List *supers)
AttributeTupleForm
attribute
=
tupleDesc
->
attrs
[
attrno
];
char
*
attributeName
;
char
*
attributeType
;
Attr
Constr
constraints
;
Tuple
Constr
constraints
;
HeapTuple
tuple
;
ColumnDef
*
def
;
TypeName
*
typename
;
...
...
src/backend/utils/cache/relcache.c
View file @
cc332d61
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.1
7 1997/08/21 01:36:09
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.1
8 1997/08/21 04:09:51
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -500,7 +500,7 @@ RelationBuildTupleDesc(RelationBuildDescInfo buildinfo,
build_tupdesc_seq
(
buildinfo
,
relation
,
natts
);
else
{
relation
->
rd_att
->
constr
=
(
AttrConstr
*
)
palloc
(
sizeof
(
struct
attr
Constr
));
relation
->
rd_att
->
constr
=
(
TupleConstr
*
)
palloc
(
sizeof
(
Tuple
Constr
));
relation
->
rd_att
->
constr
->
num_check
=
0
;
relation
->
rd_att
->
constr
->
num_defval
=
0
;
relation
->
rd_att
->
constr
->
has_not_null
=
false
;
...
...
src/include/access/tupdesc.h
View file @
cc332d61
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: tupdesc.h,v 1.
6 1997/08/19 04:45:20
vadim Exp $
* $Id: tupdesc.h,v 1.
7 1997/08/21 04:10:25
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,23 +17,38 @@
#include <access/attnum.h>
#include <catalog/pg_attribute.h>
typedef
struct
attrConstr
{
/*------------------------------------------------------------------------
This structure contains flags to the constraints of a tuple
------------------------------------------------------------------------*/
bool
has_not_null
;
}
AttrConstr
;
typedef
struct
attrDefault
{
AttrNumber
adnum
;
char
*
adbin
;
char
*
adsrc
;
}
AttrDefault
;
typedef
struct
constrCheck
{
char
*
ccname
;
char
*
ccbin
;
char
*
ccsrc
;
}
ConstrCheck
;
/* This structure contains constraints of a tuple */
typedef
struct
tupleConstr
{
AttrDefault
*
defval
;
ConstrCheck
*
check
;
uint16
num_defval
;
uint16
num_check
;
bool
has_not_null
;
}
TupleConstr
;
/*
* This structure contains all information (i.e. from Classes
* pg_attribute, pg_attrdef, pg_relcheck) for a tuple.
*/
typedef
struct
tupleDesc
{
/*------------------------------------------------------------------------
This structure contains all the attribute information (i.e. from Class
pg_attribute) for a tuple.
-------------------------------------------------------------------------*/
int
natts
;
/* Number of attributes in the tuple */
AttributeTupleForm
*
attrs
;
/* attrs[N] is a pointer to the description of Attribute Number N+1. */
Attr
Constr
*
constr
;
Tuple
Constr
*
constr
;
}
*
TupleDesc
;
extern
TupleDesc
CreateTemplateTupleDesc
(
int
natts
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment