@ -19,13 +19,13 @@
# include "nodes/pg_list.h"
# include "nodes/pg_list.h"
typedef struct a ttrDefault
typedef struct A ttrDefault
{
{
AttrNumber adnum ;
AttrNumber adnum ;
char * adbin ; /* nodeToString representation of expr */
char * adbin ; /* nodeToString representation of expr */
} AttrDefault ;
} AttrDefault ;
typedef struct c onstrCheck
typedef struct C onstrCheck
{
{
char * ccname ;
char * ccname ;
char * ccbin ; /* nodeToString representation of expr */
char * ccbin ; /* nodeToString representation of expr */
@ -34,11 +34,11 @@ typedef struct constrCheck
} ConstrCheck ;
} ConstrCheck ;
/* This structure contains constraints of a tuple */
/* This structure contains constraints of a tuple */
typedef struct t upleConstr
typedef struct T upleConstr
{
{
AttrDefault * defval ; /* array */
AttrDefault * defval ; /* array */
ConstrCheck * check ; /* array */
ConstrCheck * check ; /* array */
struct a ttrMissing * missing ; /* missing attributes values, NULL if none */
struct A ttrMissing * missing ; /* missing attributes values, NULL if none */
uint16 num_defval ;
uint16 num_defval ;
uint16 num_check ;
uint16 num_check ;
bool has_not_null ;
bool has_not_null ;
@ -75,7 +75,7 @@ typedef struct tupleConstr
* field of such a descriptor to - 1 , while reference - counted descriptors
* field of such a descriptor to - 1 , while reference - counted descriptors
* always have tdrefcount > = 0.
* always have tdrefcount > = 0.
*/
*/
typedef struct tupleDesc
typedef struct TupleDescData
{
{
int natts ; /* number of attributes in the tuple */
int natts ; /* number of attributes in the tuple */
Oid tdtypeid ; /* composite type ID for tuple type */
Oid tdtypeid ; /* composite type ID for tuple type */
@ -84,7 +84,8 @@ typedef struct tupleDesc
TupleConstr * constr ; /* constraints, or NULL if none */
TupleConstr * constr ; /* constraints, or NULL if none */
/* attrs[N] is the description of Attribute Number N+1 */
/* attrs[N] is the description of Attribute Number N+1 */
FormData_pg_attribute attrs [ FLEXIBLE_ARRAY_MEMBER ] ;
FormData_pg_attribute attrs [ FLEXIBLE_ARRAY_MEMBER ] ;
} * TupleDesc ;
} TupleDescData ;
typedef struct TupleDescData * TupleDesc ;
/* Accessor for the i'th attribute of tupdesc. */
/* Accessor for the i'th attribute of tupdesc. */
# define TupleDescAttr(tupdesc, i) (&(tupdesc)->attrs[(i)])
# define TupleDescAttr(tupdesc, i) (&(tupdesc)->attrs[(i)])
@ -98,7 +99,7 @@ extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc);
extern TupleDesc CreateTupleDescCopyConstr ( TupleDesc tupdesc ) ;
extern TupleDesc CreateTupleDescCopyConstr ( TupleDesc tupdesc ) ;
# define TupleDescSize(src) \
# define TupleDescSize(src) \
( offsetof ( struct tupleDesc , attrs ) + \
( offsetof ( struct TupleDescData , attrs ) + \
( src ) - > natts * sizeof ( FormData_pg_attribute ) )
( src ) - > natts * sizeof ( FormData_pg_attribute ) )
extern void TupleDescCopy ( TupleDesc dst , TupleDesc src ) ;
extern void TupleDescCopy ( TupleDesc dst , TupleDesc src ) ;