greenplumn pg_extprotocol 源码

  • 2022-08-18
  • 浏览 (342)

greenplumn pg_extprotocol 代码

文件路径:/src/include/catalog/pg_extprotocol.h

/*-------------------------------------------------------------------------
 *
 * pg_extprotocol.h
 *    an external table custom protocol table
 *
 * Portions Copyright (c) 2011, Greenplum Inc.
 * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
 *
 *
 * IDENTIFICATION
 *	    src/include/catalog/pg_extprotocol.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_EXTPROTOCOL_H
#define PG_EXTPROTOCOL_H

#include "catalog/genbki.h"
#include "catalog/pg_extprotocol_d.h"
#include "nodes/pg_list.h"
#include "utils/acl.h"

/* ----------------
 *		pg_extprotocol definition.  cpp turns this into
 *		typedef struct FormData_pg_extprotocol
 * ----------------
 */
CATALOG(pg_extprotocol,7175,ExtprotocolRelationId)
{
	Oid			oid;			/* oid */
	NameData	ptcname;
	Oid			ptcreadfn;
	Oid			ptcwritefn;
	Oid			ptcvalidatorfn;
	Oid			ptcowner;
	bool		ptctrusted;
#ifdef CATALOG_VARLEN			/* variable-length fields start here */
	aclitem		ptcacl[1];
#endif
} FormData_pg_extprotocol;

/* GPDB added foreign key definitions for gpcheckcat. */
FOREIGN_KEY(ptcreadfn REFERENCES pg_proc(oid));
FOREIGN_KEY(ptcwritefn REFERENCES pg_proc(oid));
FOREIGN_KEY(ptcvalidatorfn REFERENCES pg_proc(oid));

/* ----------------
 *		Form_pg_extprotocol corresponds to a pointer to a tuple with
 *		the format of pg_extprotocol relation.
 * ----------------
 */
typedef FormData_pg_extprotocol *Form_pg_extprotocol;

/*
 * Different type of functions that can be 
 * specified for a given external protocol.
 */
typedef enum ExtPtcFuncType
{
	EXTPTC_FUNC_READER,
	EXTPTC_FUNC_WRITER,
	EXTPTC_FUNC_VALIDATOR
	
} ExtPtcFuncType;

extern Oid
ExtProtocolCreate(const char *protocolName,
				  List *readfuncName,
				  List *writefuncName,
				  List *validatorfuncName,
				  bool trusted);

extern Oid
LookupExtProtocolFunction(const char *prot_name, 
						  ExtPtcFuncType prot_type,
						  bool error);

extern Oid get_extprotocol_oid(const char *prot_name, bool error_if_missing);

extern char *
ExtProtocolGetNameByOid(Oid	protOid);

#endif /* PG_EXTPROTOCOL_H */

相关信息

greenplumn 源码目录

相关文章

greenplumn aoblkdir 源码

greenplumn aocatalog 源码

greenplumn aoseg 源码

greenplumn aovisimap 源码

greenplumn binary_upgrade 源码

greenplumn catalog 源码

greenplumn catversion 源码

greenplumn dependency 源码

greenplumn genbki 源码

greenplumn gp_configuration_history 源码

0  赞