mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-17 11:57:00 +08:00
Thank god for searchable mail archives.
Patch by: wieck@sapserv.debis.de (Jan Wieck) One of the design rules of PostgreSQL is extensibility. And to follow this rule means (at least for me) that there should not only be a builtin PL. Instead I would prefer a defined interface for PL implemetations.
This commit is contained in:
@ -21,6 +21,8 @@
|
||||
#include <utils/rel.h>
|
||||
#include <storage/off.h>
|
||||
|
||||
#include <fmgr.h>
|
||||
|
||||
/*
|
||||
** You can have as many strategies as you please in GiSTs, as
|
||||
** long as your consistent method can handle them
|
||||
@ -71,13 +73,13 @@ typedef struct GISTSTACK
|
||||
|
||||
typedef struct GISTSTATE
|
||||
{
|
||||
func_ptr consistentFn;
|
||||
func_ptr unionFn;
|
||||
func_ptr compressFn;
|
||||
func_ptr decompressFn;
|
||||
func_ptr penaltyFn;
|
||||
func_ptr picksplitFn;
|
||||
func_ptr equalFn;
|
||||
FmgrInfo consistentFn;
|
||||
FmgrInfo unionFn;
|
||||
FmgrInfo compressFn;
|
||||
FmgrInfo decompressFn;
|
||||
FmgrInfo penaltyFn;
|
||||
FmgrInfo picksplitFn;
|
||||
FmgrInfo equalFn;
|
||||
bool haskeytype;
|
||||
bool keytypbyval;
|
||||
} GISTSTATE;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: skey.h,v 1.6 1997/09/08 21:51:01 momjian Exp $
|
||||
* $Id: skey.h,v 1.7 1998/01/15 19:46:18 pgsql Exp $
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
@ -17,13 +17,14 @@
|
||||
#define SKEY_H
|
||||
|
||||
#include <access/attnum.h>
|
||||
#include <fmgr.h>
|
||||
|
||||
typedef struct ScanKeyData
|
||||
{
|
||||
bits16 sk_flags; /* flags */
|
||||
AttrNumber sk_attno; /* domain number */
|
||||
RegProcedure sk_procedure; /* procedure OID */
|
||||
func_ptr sk_func;
|
||||
FmgrInfo sk_func;
|
||||
int32 sk_nargs;
|
||||
Datum sk_argument; /* data to compare */
|
||||
} ScanKeyData;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: valid.h,v 1.11 1997/11/24 05:09:41 momjian Exp $
|
||||
* $Id: valid.h,v 1.12 1998/01/15 19:46:18 pgsql Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -71,13 +71,13 @@ do \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
if (__cur_keys->sk_func == (func_ptr) oideq) /* optimization */ \
|
||||
if (__cur_keys->sk_func.fn_addr == (func_ptr) oideq) /* optimization */ \
|
||||
__test = (__cur_keys->sk_argument == __atp); \
|
||||
else if (__cur_keys->sk_flags & SK_COMMUTE) \
|
||||
__test = (long) FMGR_PTR2(__cur_keys->sk_func, __cur_keys->sk_procedure, \
|
||||
__test = (long) FMGR_PTR2(&__cur_keys->sk_func, \
|
||||
__cur_keys->sk_argument, __atp); \
|
||||
else \
|
||||
__test = (long) FMGR_PTR2(__cur_keys->sk_func, __cur_keys->sk_procedure, \
|
||||
__test = (long) FMGR_PTR2(&__cur_keys->sk_func, \
|
||||
__atp, __cur_keys->sk_argument); \
|
||||
\
|
||||
if (!__test == !(__cur_keys->sk_flags & SK_NEGATE)) \
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: vacuum.h,v 1.11 1997/11/26 01:26:08 momjian Exp $
|
||||
* $Id: vacuum.h,v 1.12 1998/01/15 19:46:24 pgsql Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -78,7 +78,7 @@ typedef struct
|
||||
nonnull_cnt;
|
||||
int32 max_cnt,
|
||||
min_cnt;
|
||||
func_ptr f_cmpeq,
|
||||
FmgrInfo f_cmpeq,
|
||||
f_cmplt,
|
||||
f_cmpgt;
|
||||
regproc outfunc;
|
||||
|
||||
@ -6,19 +6,21 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: fcache.h,v 1.5 1997/09/08 21:54:57 momjian Exp $
|
||||
* $Id: fcache.h,v 1.6 1998/01/15 19:46:36 pgsql Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef FCACHE_H
|
||||
#define FCACHE_H
|
||||
|
||||
#include <fmgr.h>
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int typlen; /* length of the return type */
|
||||
int typbyval; /* true if return type is pass by value */
|
||||
func_ptr func; /* address of function to call (for c
|
||||
FmgrInfo func; /* address of function to call (for c
|
||||
* funcs) */
|
||||
Oid foid; /* oid of the function in pg_proc */
|
||||
Oid language; /* oid of the language in pg_language */
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: rel.h,v 1.14 1997/11/21 19:12:32 momjian Exp $
|
||||
* $Id: rel.h,v 1.15 1998/01/15 19:46:37 pgsql Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -24,8 +24,7 @@ typedef struct Trigger
|
||||
{
|
||||
char *tgname;
|
||||
Oid tgfoid;
|
||||
func_ptr tgfunc;
|
||||
func_ptr tgplfunc;
|
||||
FmgrInfo tgfunc;
|
||||
int16 tgtype;
|
||||
int16 tgnargs;
|
||||
int16 tgattr[8];
|
||||
|
||||
Reference in New Issue
Block a user