diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catname.h | 3 | ||||
-rw-r--r-- | src/include/catalog/indexing.h | 8 | ||||
-rw-r--r-- | src/include/catalog/pg_largeobject.h | 63 | ||||
-rw-r--r-- | src/include/storage/large_object.h | 19 |
4 files changed, 77 insertions, 16 deletions
diff --git a/src/include/catalog/catname.h b/src/include/catalog/catname.h index 765f9b2d0a1..cb95771147d 100644 --- a/src/include/catalog/catname.h +++ b/src/include/catalog/catname.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catname.h,v 1.14 2000/10/08 03:53:15 momjian Exp $ + * $Id: catname.h,v 1.15 2000/10/21 15:55:28 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,7 @@ #define InheritsRelationName "pg_inherits" #define InheritancePrecidenceListRelationName "pg_ipl" #define LanguageRelationName "pg_language" +#define LargeobjectRelationName "pg_largeobject" #define ListenerRelationName "pg_listener" #define LogRelationName "pg_log" #define OperatorClassRelationName "pg_opclass" diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h index d96115fa9a3..7bee3e0f039 100644 --- a/src/include/catalog/indexing.h +++ b/src/include/catalog/indexing.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: indexing.h,v 1.42 2000/10/08 03:53:15 momjian Exp $ + * $Id: indexing.h,v 1.43 2000/10/21 15:55:28 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -31,6 +31,7 @@ #define Num_pg_index_indices 2 #define Num_pg_inherits_indices 1 #define Num_pg_language_indices 2 +#define Num_pg_largeobject_indices 2 #define Num_pg_listener_indices 1 #define Num_pg_opclass_indices 2 #define Num_pg_operator_indices 2 @@ -62,6 +63,8 @@ #define InheritsRelidSeqnoIndex "pg_inherits_relid_seqno_index" #define LanguageNameIndex "pg_language_name_index" #define LanguageOidIndex "pg_language_oid_index" +#define LargeobjectLOIdIndex "pg_largeobject_loid_index" +#define LargeobjectLOIdPNIndex "pg_largeobject_loid_pn_index" #define ListenerPidRelnameIndex "pg_listener_pid_relname_index" #define OpclassDeftypeIndex "pg_opclass_deftype_index" #define OpclassNameIndex "pg_opclass_name_index" @@ -92,6 +95,7 @@ extern char *Name_pg_group_indices[]; extern char *Name_pg_index_indices[]; extern char *Name_pg_inherits_indices[]; extern char *Name_pg_language_indices[]; +extern char *Name_pg_largeobject_indices[]; extern char *Name_pg_listener_indices[]; extern char *Name_pg_opclass_indices[]; extern char *Name_pg_operator_indices[]; @@ -191,6 +195,8 @@ DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index on pg_index using btree(indexreli DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops)); DECLARE_UNIQUE_INDEX(pg_language_name_index on pg_language using btree(lanname name_ops)); DECLARE_UNIQUE_INDEX(pg_language_oid_index on pg_language using btree(oid oid_ops)); +DECLARE_INDEX(pg_largeobject_loid_index on pg_largeobject using btree(loid oid_ops)); +DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index on pg_largeobject using btree(loid oid_ops, pageno int4_ops)); DECLARE_UNIQUE_INDEX(pg_listener_pid_relname_index on pg_listener using btree(listenerpid int4_ops, relname name_ops)); /* This column needs to allow multiple zero entries, but is in the cache */ DECLARE_INDEX(pg_opclass_deftype_index on pg_opclass using btree(opcdeftype oid_ops)); diff --git a/src/include/catalog/pg_largeobject.h b/src/include/catalog/pg_largeobject.h new file mode 100644 index 00000000000..409aaf8d226 --- /dev/null +++ b/src/include/catalog/pg_largeobject.h @@ -0,0 +1,63 @@ +/*------------------------------------------------------------------------- + * + * pg_largeobject.h + * definition of the system "largeobject" relation (pg_largeobject) + * along with the relation's initial contents. + * + * + * Portions Copyright (c) 1996-2000, PostgreSQL, Inc + * Portions Copyright (c) 1994, Regents of the University of California + * + * $Id: pg_largeobject.h,v 1.3 2000/10/21 15:55:28 momjian Exp $ + * + * NOTES + * the genbki.sh script reads this file and generates .bki + * information from the DATA() statements. + * + *------------------------------------------------------------------------- + */ +#ifndef PG_LARGEOBJECT_H +#define PG_LARGEOBJECT_H + +/* ---------------- + * postgres.h contains the system type definintions and the + * CATALOG(), BOOTSTRAP and DATA() sugar words so this file + * can be read by both genbki.sh and the C compiler. + * ---------------- + */ + +/* ---------------- + * pg_largeobject definition. cpp turns this into + * typedef struct FormData_pg_largeobject. Large object id + * is stored in loid; + * ---------------- + */ + +CATALOG(pg_largeobject) +{ + Oid loid; + int4 pageno; + bytea data; +} FormData_pg_largeobject; + +/* ---------------- + * Form_pg_largeobject corresponds to a pointer to a tuple with + * the format of pg_largeobject relation. + * ---------------- + */ +typedef FormData_pg_largeobject *Form_pg_largeobject; + +/* ---------------- + * compiler constants for pg_largeobject + * ---------------- + */ +#define Natts_pg_largeobject 3 +#define Anum_pg_largeobject_loid 1 +#define Anum_pg_largeobject_pageno 2 +#define Anum_pg_largeobject_data 3 + +Oid LargeobjectCreate(Oid loid); +void LargeobjectDrop(Oid loid); +int LargeobjectFind(Oid loid); + +#endif /* PG_LARGEOBJECT_H */ diff --git a/src/include/storage/large_object.h b/src/include/storage/large_object.h index b3d3512d949..77990c56335 100644 --- a/src/include/storage/large_object.h +++ b/src/include/storage/large_object.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: large_object.h,v 1.15 2000/10/08 03:53:15 momjian Exp $ + * $Id: large_object.h,v 1.16 2000/10/21 15:55:29 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,17 +22,11 @@ /* * This structure will eventually have lots more stuff associated with it. */ -typedef struct LargeObjectDesc -{ - Relation heap_r; /* heap relation */ - Relation index_r; /* index relation on seqno attribute */ - IndexScanDesc iscan; /* index scan we're using */ - TupleDesc hdesc; /* heap relation tuple desc */ - TupleDesc idesc; /* index relation tuple desc */ - uint32 lowbyte; /* low byte on the current page */ - uint32 highbyte; /* high byte on the current page */ +typedef struct LargeObjectDesc { + Relation heap_r; + Relation index_r; uint32 offset; /* current seek pointer */ - ItemPointerData htid; /* tid of current heap tuple */ + Oid id; #define IFS_RDLOCK (1 << 0) #define IFS_WRLOCK (1 << 1) @@ -55,7 +49,4 @@ extern int inv_tell(LargeObjectDesc *obj_desc); extern int inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes); extern int inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes); -/* added for buffer leak prevention [ PA ] */ -extern void inv_cleanindex(LargeObjectDesc *obj_desc); - #endif /* LARGE_OBJECT_H */ |