pg_appendonly_alter_column.h 2.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*-------------------------------------------------------------------------
*
* pg_appendonly_alter_column.h
*	  Internal specifications of the pg_appendonly_alter_column relation storage.
*
* Copyright (c) 2008-2010, Greenplum Inc.
*-------------------------------------------------------------------------
*/
#ifndef PG_APPENDONLY_ALTER_COLUMN_H
#define PG_APPENDONLY_ALTER_COLUMN_H

#include "catalog/genbki.h"
/*
 * pg_appendonly_alter_column definition.
 */

/* TIDYCAT_BEGINFAKEDEF

   CREATE TABLE pg_appendonly_alter_column
20
   with (camelcase=AppendOnlyAlterColumn, oid=false, relid=6110)
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
   (
   relid             oid, 
   changenum         integer, 
   segfilenums       integer[], 
   highwaterrownums  bytea
   );

   create unique index on pg_appendonly_alter_column(relid, changenum) with (indexid=5031, CamelCase=AppendOnlyAlterColumnRelid);

   alter table pg_appendonly_alter_column add fk relid on pg_class(oid);

   TIDYCAT_ENDFAKEDEF
*/

#define AppendOnlyAlterColumnRelationId  6110

CATALOG(pg_appendonly_alter_column,6110) BKI_WITHOUT_OIDS
{
	Oid			relid;		/* relation id */
	
	/* 
	 * The change number for the ALTER TABLE ADD/DROP
	 * COLUMN operation.  Starts at 1.
	 */
	int4		changenum;			

	/*
	 * THE REST OF THESE ARE VARIABLE LENGTH FIELDS.
	 * They cannot be accessed as C struct entries; you have to use
	 * the full field access machinery (heap_getattr) for them.  We declare
	 * them here for the catalog machinery.
	 */

	/* The array of int4 segment file numbers for the highwater row numbers. */
	int4		segfilenums[1];

	/* 
	 * The array of int64 row numbers that are the logical end of the segment
	 * files. Unfortunately, we cannot properly represent it as an array of
	 * int8 or float8, so we use raw bytes.
	 */
	bytea		highwaterrownums;		
} FormData_pg_appendonly_alter_column;


/* ----------------
*		Form_pg_appendonly corresponds to a pointer to a tuple with
*		the format of pg_appendonly relation.
* ----------------
*/
typedef FormData_pg_appendonly_alter_column *Form_pg_appendonly_alter_column;

#define Natts_pg_appendonly_alter_column					4
#define Anum_pg_appendonly_alter_column_relid				1
#define Anum_pg_appendonly_alter_column_changenum			2
#define Anum_pg_appendonly_alter_column_segfilenums			3
#define Anum_pg_appendonly_alter_column_highwaterrownums	4

#endif   /* PG_APPENDONLY_ALTER_COLUMN_H */